Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mini-program-wepy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
mini-program-wepy
Commits
1140bf69
Commit
1140bf69
authored
Jul 13, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"fix: 请求超时处理;金币图片拉伸修复;修复抽奖展示热区遮挡"
parent
e7170ade
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
.eslintcache
.eslintcache
+1
-1
app.wpy
src/app.wpy
+3
-0
wxRequest.js
src/common/wxRequest.js
+4
-0
activityList.wpy
src/components/custom/activityList.wpy
+2
-3
No files found.
.eslintcache
View file @
1140bf69
{"D:\\project\\mini-program-wepy\\src\\app.wpy":{"size":1554,"mtime":1594112587014,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\app.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\api.js":{"size":1949,"mtime":1594112587014,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\api.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\eventHub.js":{"size":90,"mtime":1594112587015,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\eventHub.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\raffleProbability.js":{"size":1792,"mtime":1594112587015,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\raffleProbability.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\wxRequest.js":{"size":2437,"mtime":1594201063892,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\wxRequest.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\activityList.wpy":{"size":2631,"mtime":1594112587016,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\activityList.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\china.js":{"size":102261,"mtime":1594112587017,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\china.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\goloading.wpy":{"size":1103,"mtime":1594112587017,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\goloading.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\goodsList.wpy":{"size":9486,"mtime":1594112587018,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\goodsList.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\loading.wpy":{"size":1260,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\loading.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\network.wpy":{"size":1517,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\network.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\openAnimation.wpy":{"size":17653,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\openAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\popup.wpy":{"size":4977,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\popup.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\sharedPopup.wpy":{"size":8545,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\sharedPopup.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\sign.wpy":{"size":12185,"mtime":1594209125993,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\sign.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\starAnimation.wpy":{"size":4063,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\starAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\video.wpy":{"size":11837,"mtime":1594200158186,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\video.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\videoPause.wpy":{"size":941,"mtime":1594112587022,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\videoPause.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\agreement.wpy":{"size":225,"mtime":1594112587148,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\agreement.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\help.wpy":{"size":3183,"mtime":1594112587148,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\help.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\index.wpy":{"size":19387,"mtime":1594265115192,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\index.wpy","messages":[],"errorCount":0,"warningCount":0,"output":"<style lang=\"less\">\n @import \"../style/common\";\n page{\n height: 100%;\n background-color: #000;\n }\n .video-wrapper{\n width: 100%;\n height: 100%;\n }\n .prize{\n width: 100%;\n height: 100%;\n position: absolute;\n z-index: 0;\n background-color:rgba(0, 0, 0, 0.7);\n }\n .userInfo{\n position: fixed;\n z-index: 10;\n top:100rpx;\n left: 30rpx;\n }\n .userinfo-button {\n width: 80rpx;\n height: 80rpx;\n padding: 0;\n border: none;\n background-color: transparent;\n &::after {\n border: none;\n };\n .userinfo-image {\n width: 80rpx;\n height: 80rpx;\n border-radius: 50%;\n }\n }\n .userimage{\n width: 80rpx;\n height: 80rpx;\n border-radius: 50%;\n }\n .search{\n position: fixed;\n z-index: 10;\n top:100rpx;\n left: 310rpx;\n font-size: @font-large;\n color: @whitecolor;\n .searchimg {\n width: 34rpx;\n height: 34rpx;\n vertical-align: middle;\n }\n }\n @-webkit-keyframes fadeout {\n 0% {\n opacity:1 ;\n }\n 100% {\n opacity: 0;\n }\n }\n .content{\n position: absolute;\n z-index: 9;\n bottom: 400rpx;\n width: 100%;\n color: @whitecolor;\n clear: both;\n &.anima {\n animation:fadeout 2s;\n }\n &.hide {\n display: none;\n }\n }\n .leftcont {\n width: 44%;\n float: left;\n font-size: @font-normal;\n margin-left: 30rpx;\n }\n .list-wrapper {\n height: 120rpx;\n }\n .leftcont .img {\n width: 40rpx;\n height: 40rpx;\n border-radius: 50%;\n vertical-align: middle;\n }\n .leftcont .text {\n max-width: 200rpx;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-left: 10rpx;\n vertical-align: middle;\n border-radius: 20rpx;\n display: inline-block;\n font-size: @font-small;\n box-sizing: border-box;\n padding:6rpx 15rpx;\n background-color:rgba(238, 238, 238, 0.2);\n }\n .corn-cont {\n width:550rpx;\n height:474rpx;\n position: relative;\n .imgs {\n width:100%;\n height:100%;\n position: absolute;\n top:0;left:0;\n z-index:0;\n }\n .corn-title {\n font-size: 34rpx;\n text-align: center;\n padding-top:50rpx;\n position: relative;\n z-index:2;\n }\n .corn-input{\n width:300rpx;\n height:70rpx;\n margin:0 auto;\n margin-top:30rpx;\n background-color: #ddd;\n line-height:70rpx;\n font-size: 32rpx;\n border-radius:35rpx;\n padding:0 30rpx;\n position: relative;\n z-index: 2;\n }\n .error-text {\n color:@redcolor;\n font-size: 22rpx;\n width:360rpx;\n margin:0 auto;\n padding:13rpx 0;\n position: relative;\n z-index: 2;\n &.hidden {\n visibility: hidden;\n }\n }\n .corn-icon{\n width: 74rpx;\n height:80rpx;\n margin:0 auto;\n display: block;\n position: relative;\n z-index: 2;\n }\n .corn-button {\n width:280rpx;\n height:80rpx;\n margin:0 auto;\n display: block;\n background-color: @whiteback;\n text-align: center;\n line-height:80rpx;\n color:@maincolor;\n font-size: 34rpx;\n border-radius: 10rpx;\n margin-top:10rpx;\n }\n }\n .img-wrapper{\n padding:30rpx;\n }\n</style>\n<template>\n <view class=\"video-wrapper\">\n <view class=\"prize\">\n <!--<prize-list :videoList=\"videoList\" :userAccount=\"mainInfo && mainInfo.account && mainInfo.account.quantity || 0\" bindchange=\"changeVideo\" @getAwardsInfo=\"getAwardsInfo\">\n </prize-list>-->\n <video-list :videoList=\"videoList\" :userAccount=\"mainInfo && mainInfo.account && mainInfo.account.quantity || 0\" bindchange=\"changeVideo\" @getAwardsInfo=\"getAwardsInfo\"></video-list>\n </view>\n <view class=\"userInfo\" style=\"{{ safeAreaStyle }}\">\n <button v-if=\"authmodal\" open-type=\"getUserInfo\" bindgetuserinfo=\"getUserInfo\" class=\"userinfo-button\">\n <image class=\"userinfo-image\" :src=\"userInfo.avatarUrl\"></image>\n </button>\n <image v-if=\"!authmodal\" @tap=\"showMenu(!showModal)\" :src=\"userInfo.avatarUrl\" mode=\"cover\" class=\"userimage\"></image>\n </view>\n <view class=\"search\" style=\"{{ searchStyle }}\" bindtap=\"toSearch\">\n <image src=\"/static/images/search.png\" class=\"searchimg\"></image>\n 搜索\n </view>\n <view>\n <gold type=\"gold\" :des=\"mainInfo && mainInfo.account && mainInfo.account.quantity || 0\" :gold=\"sign\" :isReceive=\"isReceive\" @resetAddGold=\"resetAddGold\" @showCorn=\"cornModalShow\"></gold>\n <sign type=\"sign\" des=\"签到\" :sign=\"sign\" @sign-in=\"signIn\"></sign>\n <lottery type=\"lottery\" des=\"抽奖\" @getAwards=\"getAwards\" @getUserInfo=\"getUserInfo\" :authmodal=\"authmodal\"></lottery>\n <share type=\"share\" des=\"分享\" v-if=\"awardsInfo.id == undefined || awardsInfo.id >0\"></share>\n </view>\n <activity-list :activityList=\"activityList\"></activity-list>\n <network v-if=\"isConnected === false\"/>\n <open-animation v-if=\"showModal === 2\" :joinRecord=\"mainInfo && mainInfo.joinRecord\"/>\n <shared-popup v-if=\"showModal === 1\" :inviteinfo=\"mainInfo && mainInfo.inviteRecord\" @getSharedGold=\"getSharedGold\"/>\n <shared-popup v-if=\"showModal === 4\" :inviteinfo=\"mainInfo && mainInfo.buyRecord\" type=\"buy\" @getSharedGold=\"getSharedGold\"/>\n <popup @showMenu=\"showMenu\" :showMenus=\"showModal === 3\"/>\n <!--商品推荐列表-->\n <goods-list></goods-list>\n <van-dialog id=\"van-dialog\"/>\n <van-notify id=\"van-notify\"/>\n <!--克币充值弹窗-->\n <van-popup show=\"{{ cornModal }}\" bind:close=\"ModalClose\" custom-style=\"background-color:transparent\">\n <view class=\"corn-cont\">\n <image src=\"/static/images/cornback.png\" class=\"imgs\"></image>\n <view class=\"corn-title\">请输入充值码</view>\n <view><input type=\"text\" class=\"corn-input\" v-model=\"cornCode\"></view>\n <view class=\"error-text {{!cornTextShow?'hidden':''}}\">{{ cornText }}</view>\n <image src=\"/static/images/corn.png\" class=\"corn-icon\"></image>\n <button class=\"corn-button\" bindtap=\"checkCode\">确定</button>\n </view>\n </van-popup>\n <!--活动图片弹窗-->\n <van-popup show=\"{{ avtivityModal }}\" bind:close=\"ModalClose\" round closeable>\n <view class=\"img-wrapper\">\n <van-image use-loading-slot src=\"{{ mainInfo.activity && mainInfo.activity.linkUrl }}\" width=\"400rpx\" fit=\"widthFix\" radius=\"10rpx\">\n <van-loading slot=\"loading\" type=\"spinner\" size=\"30\" vertical />\n </van-image>\n </view>\n </van-popup>\n </view>\n</template>\n\n<script>\n import store from '../store';\n import { mapState, mapActions } from '@wepy/x';\n import wepy from '@wepy/core';\n import { debounce } from '../common/utils';\n import Notify from '../components/vant/notify/notify';\n import Dialog from '../components/vant/dialog/dialog';\n import { login, register, getMainInfo, addGold, getPrizeList, signIn, getActivityFeed, checkCornCode } from '../common/api.js';\n let flag = false;\n wepy.page({\n store,\n data: {\n videoList: [],\n goodsList: [],\n activityList: [],\n authmodal: false,\n sign: true,\n inviter: '',\n mainInfo: null,\n showModal: 0, // 1: 邀请好友金币弹窗 2: 展示抽奖弹窗 3: 头像菜单弹窗 4: 购买获得金币弹窗\n isReceive: false, // 是否显示领取克币动画\n cornModal: false,\n cornCode: '', // 克币充值码\n cornText: '',\n cornTextShow: true,\n searchStyle: '',\n avtivityModal: false, // 展示活动弹窗\n awardsInfo: {}\n },\n\n computed: {\n ...mapState([ 'isConnected', 'userInfo', 'safeAreaStyle' ])\n },\n watch: {\n cornCode(val, oldval) {\n if (val !== oldval && this.cornTextShow) {\n this.cornTextShow = false;\n }\n }\n },\n methods: {\n ...mapActions([ 'setIsConnected', 'setUserInfo', 'setSafeAreaStyle' ]),\n async getUserInfo (e, isFromLottery) {\n if (e.$wx.detail.userInfo) {\n this.setUserInfo(e.$wx.detail.userInfo);\n this.authmodal = false;\n await this.registUser(e.$wx.detail.userInfo);\n if (isFromLottery) {\n this.getAwards();\n }\n }\n },\n changeVideo() {\n this.setIsConnected();\n },\n signIn: async function() {\n let that = this;\n const tmplIds = [\n 'xbA7XopO2j0V0Ne0F61UzSxoyfKrf92GQk6Z4pQvnd4',\n '_yZWJYT-3lGCQG6g7Wa7F-0zxvGaPe4zwAI9D4zW4EY',\n '7YzXgiVNGXiRvXNmR6WUtH_WplUyo97eAy45dsyviKQ'\n ];\n const { subscriptionsSetting } = await wepy.wx.getSetting({ withSubscriptions: true });\n if (subscriptionsSetting && (!subscriptionsSetting.mainSwitch || subscriptionsSetting.itemSettings)) {\n let isAlwaysAgree = true;\n if (subscriptionsSetting.itemSettings) {\n const itemKeys = Object.keys(subscriptionsSetting.itemSettings);\n isAlwaysAgree = itemKeys.every(v => subscriptionsSetting.itemSettings[v] === 'accept');\n }\n if (!isAlwaysAgree || !subscriptionsSetting.mainSwitch) {\n try {\n await Dialog.alert({\n message: '点击右上角“...” - 设置 - 消息订阅,开启接收订阅消息并选择所有消息',\n showCancelButton: true,\n confirmButtonText: '去设置'\n });\n await wepy.wx.openSetting();\n } catch (e) {\n console.log(e || e.message);\n }\n return;\n }\n }\n wepy.wx.showLoading({\n title: '请稍候...',\n mask: true\n });\n wx.requestSubscribeMessage({\n tmplIds,\n success (res) {\n console.log('requestSubscribeMessage success', res);\n if (res.errMsg === 'requestSubscribeMessage:ok') {\n // 兼容写法,有时响应中的模板id不是3个\n const rs = tmplIds.every(v => res[v] === undefined || res[v] === 'accept');\n if (rs) {\n that.sign = true;\n debounce(async () => {\n const innerAudioContext = wx.createInnerAudioContext();\n innerAudioContext.autoplay = true;\n innerAudioContext.src = '/static/audio/supermarie.mp3';\n innerAudioContext.onPlay(() => {});\n innerAudioContext.onError((res) => {\n console.log(res.errMsg);\n console.log(res.errCode);\n });\n const { coins } = await signIn();\n wepy.wx.hideLoading();\n if (coins === 0) return;\n that.mainInfo.account.quantity = coins;\n }, 700)();\n } else {\n wepy.wx.hideLoading();\n }\n } else {\n wepy.wx.hideLoading();\n }\n },\n fail (res) {\n console.log('requestSubscribeMessage fail', res);\n wepy.wx.hideLoading();\n }\n });\n },\n onShareAppMessage: function(res) {\n if (res.from === 'button') {\n console.log('onShareAppMessage2', res.target);\n }\n const openid = wx.getStorageSync('openId');\n return {\n title: `${(this.$wepy.userInfo && this.$wepy.userInfo.nickName) || '您的好朋友'}邀请您来抽奖啦~`,\n path: `/pages/index?openid=${openid}&prizeId=${this.$wepy.awardsInfo.id}`,\n imageUrl: decodeURIComponent(this.$wepy.awardsInfo.photoUrl),\n success: function(res) {\n let shareId = res.shareTickets[0];\n console.log('shareId', shareId);\n },\n fail: function(res) {\n console.log(res);\n }\n };\n },\n getAwards: function() {\n const { id, photoUrl, name, chance } = this.awardsInfo;\n if ((!id && id !== 0) || !this.mainInfo || !this.mainInfo.account) {\n Notify({ message: '服务器异常,请稍后重试', safeAreaInsetTop: true });\n return;\n }\n if (this.mainInfo && this.mainInfo.account && this.mainInfo.account.quantity === 0) {\n Notify({ message: '您的克币数为0, 无法参与抽奖', safeAreaInsetTop: true });\n return;\n }\n if (id <= 0) {\n Notify({ message: '当前视频为规则说明, 无法参与抽奖', safeAreaInsetTop: true });\n return;\n }\n\n wx.navigateTo({\n url: `/pages/raffle?prizeId=${id}&chance=${chance}&photoUrl=${photoUrl}&quantity=${this.mainInfo.account.quantity}&name=${name}`\n });\n },\n getAwardsInfo: function(v) {\n this.awardsInfo = v;\n },\n showMenu: function(v) {\n this.showModal = v ? 3 : 0;\n },\n getSharedGold: async function(v) {\n let modal = this.showModal;\n this.showModal = 0;\n await addGold(v);\n this.showActivity();\n let account = this.mainInfo.account || {};\n let quantity = account.quantity || 0;\n this.mainInfo.account.quantity = quantity + v.quantity;\n this.isReceive = true;\n setTimeout(() => {\n if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length && modal !== 4) {\n this.showModal = 4;\n return;\n }\n if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {\n this.showModal = 2;\n }\n }, 1000);\n },\n getMainInfo: async function() {\n this.mainInfo = await getMainInfo();\n this.sign = this.mainInfo && this.mainInfo.signin;\n wx.setStorageSync('hasPhone', this.mainInfo.phone);\n const activityId = wx.getStorageSync('activityId');\n if (this.mainInfo && this.mainInfo.innerActivity) {\n wx.setStorageSync('innerActivity', this.mainInfo.innerActivity);\n } else {\n wx.setStorageSync('innerActivity', '');\n }\n // 弹窗有多个,展示顺序 活动弹窗->邀请好友->购买获得克币->开奖宝箱\n if (this.mainInfo.activity && this.mainInfo.activity.id && this.mainInfo.activity.id !== +activityId) {\n // 活动弹窗\n this.avtivityModal = true;\n } else if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {\n // 邀请好友\n this.showModal = 1;\n } else if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length) {\n // 购买获得金币\n this.showModal = 4;\n } else if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {\n // 开奖宝箱\n this.showModal = 2;\n }\n },\n async registUser(userInfo) {\n if (wx.getStorageSync('isRegister') === false) {\n const params = {\n ...userInfo,\n inviter: this.inviter\n };\n await register(params);\n wx.setStorageSync('isRegister', true);\n }\n },\n async showActivity() {\n // 1期方案先一次取50\n const list = await getActivityFeed({ count: 50 });\n this.activityList = list;\n },\n async getOpenId() {\n const { code } = await wepy.wx.login();\n let loginInfo = await login(code);\n loginInfo = loginInfo || {};\n wx.setStorageSync('openId', loginInfo.openid);\n wx.setStorageSync('isRegister', loginInfo.register);\n },\n cornModalShow() {\n this.cornTextShow = false;\n this.cornCode = '';\n this.cornModal = true;\n },\n ModalClose() {\n this.cornModal && (this.cornModal = false);\n if (this.avtivityModal) {\n wx.setStorageSync('activityId', this.mainInfo.activity.id);\n this.avtivityModal = false;\n if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {\n this.showModal = 1;\n } else if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length) {\n this.showModal = 4;\n } else if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {\n this.showModal = 2;\n }\n }\n },\n checkCode() {\n if (this.cornCode === '') {\n this.cornText = '请输入克币充值码';\n this.cornTextShow = true;\n return;\n }\n const msg = ['充值码无效,请重新输入', '该充值码已被使用,请重新输入'];\n checkCornCode({code: this.cornCode}).then(data => {\n if (data.code === 0) {\n // 充值成功\n this.cornModal = false;\n this.mainInfo.account.quantity = data.accountCoins;\n this.isReceive = true;\n } else {\n const msgindex = data.code + 2;\n this.cornText = msg[msgindex];\n this.cornTextShow = true;\n }\n });\n },\n resetAddGold() {\n this.isReceive = false;\n },\n toSearch() {\n wx.navigateTo({url: '/pages/search'});\n }\n },\n async onLoad (options) {\n this.cornText = '充值码错误';\n // 获取分享人openid\n if (options.openid) {\n this.inviter = options.openid;\n }\n\n // 获取头像安全距离\n let statusHeight = this.$app.$options.globalData.statusBarHeight || '';\n this.setSafeAreaStyle('top:' + statusHeight + 'px');\n this.searchStyle = 'top:' + (statusHeight + 12) + 'px';\n // 获取openid\n await this.getOpenId();\n\n // 获取奖品列表\n this.videoList = await getPrizeList(options.prizeId);\n\n this.getMainInfo();\n flag = true;\n\n // 获取用户信息并注册\n if (this.userInfo.nickName) {\n this.registUser(this.userInfo);\n } else {\n const setting = await wepy.wx.getSetting();\n if (setting.authSetting['scope.userInfo']) {\n const { userInfo } = await wepy.wx.getUserInfo();\n this.setUserInfo(userInfo);\n this.registUser(userInfo);\n } else {\n this.authmodal = true;\n }\n }\n\n // 获取活动信息\n this.showActivity();\n },\n async onShow() {\n // 获取主页信息\n if (flag) {\n this.getMainInfo();\n }\n\n let join = wx.getStorageSync('userJoin');\n if (join === 1) {\n wx.removeStorageSync('userJoin');\n this.showActivity();\n }\n }\n\n });\n</script>\n<config>\n {\n navigationBarTitleText: '主页',\n usingComponents: {\n 'van-button': '../components/vant/button/index',\n 'van-icon': '../components/vant/icon/index',\n 'sign': '\\x7e@/components/custom/sign',\n 'gold': '~@/components/custom/sign',\n 'share': '~@/components/custom/sign',\n 'lottery': '~@/components/custom/sign',\n 'network': '~@/components/custom/network',\n 'open-animation': '~@/components/custom/openAnimation',\n 'popup': '~@/components/custom/popup',\n 'van-notify': '~@/components/vant/notify/index',\n 'shared-popup': '~@/components/custom/sharedPopup',\n 'van-dialog': '~@/components/vant/dialog/index',\n 'goods-list': '../components/custom/goodsList',\n 'activity-list': '../components/custom/activityList',\n 'van-popup':'../components/vant/popup/index',\n 'video-list':'../components/custom/video',\n \"van-image\": \"../components/vant/image/index\",\n \"van-loading\": \"../components/vant/loading/index\",\n },\n navigationStyle: \"custom\",\n disableScroll: true\n }\n</config>\n"}},"D:\\project\\mini-program-wepy\\src\\pages\\morehelp.wpy":{"size":269,"mtime":1594112587149,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\morehelp.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\myraffles.wpy":{"size":3271,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\myraffles.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\prize.wpy":{"size":7951,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\prize.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\raffle.wpy":{"size":13368,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\raffle.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\search.wpy":{"size":5690,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\search.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\store\\index.js":{"size":850,"mtime":1594112587151,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\store\\index.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\utils.js":{"size":1288,"mtime":1594264466804,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\utils.js","messages":[],"errorCount":0,"warningCount":0}}}
\ No newline at end of file
{"D:\\project\\mini-program-wepy\\src\\app.wpy":{"size":1554,"mtime":1594112587014,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\app.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\api.js":{"size":1949,"mtime":1594112587014,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\api.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\eventHub.js":{"size":90,"mtime":1594112587015,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\eventHub.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\raffleProbability.js":{"size":1792,"mtime":1594112587015,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\raffleProbability.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\wxRequest.js":{"size":2437,"mtime":1594201063892,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\wxRequest.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\activityList.wpy":{"size":2631,"mtime":1594379850591,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\activityList.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\china.js":{"size":102261,"mtime":1594112587017,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\china.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\goloading.wpy":{"size":1103,"mtime":1594112587017,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\goloading.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\goodsList.wpy":{"size":9486,"mtime":1594112587018,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\goodsList.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\loading.wpy":{"size":1260,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\loading.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\network.wpy":{"size":1517,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\network.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\openAnimation.wpy":{"size":17653,"mtime":1594112587019,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\openAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\popup.wpy":{"size":4977,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\popup.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\sharedPopup.wpy":{"size":8545,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\sharedPopup.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\sign.wpy":{"size":11743,"mtime":1594380552044,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\sign.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\starAnimation.wpy":{"size":4063,"mtime":1594112587020,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\starAnimation.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\video.wpy":{"size":11837,"mtime":1594379901688,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\video.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\components\\custom\\videoPause.wpy":{"size":941,"mtime":1594112587022,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\components\\custom\\videoPause.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\agreement.wpy":{"size":225,"mtime":1594112587148,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\agreement.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\help.wpy":{"size":3183,"mtime":1594112587148,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\help.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\index.wpy":{"size":19387,"mtime":1594265220597,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\index.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\morehelp.wpy":{"size":269,"mtime":1594112587149,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\morehelp.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\myraffles.wpy":{"size":3271,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\myraffles.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\prize.wpy":{"size":7951,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\prize.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\raffle.wpy":{"size":13368,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\raffle.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\pages\\search.wpy":{"size":5690,"mtime":1594112587150,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\pages\\search.wpy","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\store\\index.js":{"size":850,"mtime":1594112587151,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\store\\index.js","messages":[],"errorCount":0,"warningCount":0}},"D:\\project\\mini-program-wepy\\src\\common\\utils.js":{"size":1288,"mtime":1594264466804,"hashOfConfig":"p3gqur","results":{"filePath":"D:\\project\\mini-program-wepy\\src\\common\\utils.js","messages":[],"errorCount":0,"warningCount":0}}}
\ No newline at end of file
src/app.wpy
View file @
1140bf69
...
...
@@ -55,6 +55,9 @@ wepy.app({
'pages/search',
'pages/agreement'
],
"networkTimeout": {
"request": 3000
},
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#f1f1f1',
...
...
src/common/wxRequest.js
View file @
1140bf69
...
...
@@ -58,6 +58,10 @@ const request = async (url, options) => {
errMsg
=
`httpurl:
${
url
}
, method:
${
options
.
method
}
, params:
${
JSON
.
stringify
(
options
.
data
)}
, status:
${
res
.
statusCode
}
, data:
${
JSON
.
stringify
(
res
.
data
)}
`
;
if
(
env
===
'
test
'
)
console
.
error
(
errMsg
);
throw
new
Error
(
errMsg
);
}).
catch
(
e
=>
{
if
(
e
.
errMsg
===
'
request:fail timeout
'
)
{
Notify
({
message
:
'
网络异常,请稍后重试
'
,
safeAreaInsetTop
});
}
});
};
...
...
src/components/custom/activityList.wpy
View file @
1140bf69
...
...
@@ -66,7 +66,7 @@
position: absolute;
z-index: 9;
bottom: 400rpx;
width:
100
%;
width:
44
%;
color: @whitecolor;
clear: both;
&.anima {
...
...
@@ -77,8 +77,7 @@
}
}
.leftcont {
width: 44%;
float: left;
width: 100%;
font-size: @font-normal;
margin-left: 30rpx;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment