From 81fc7653c881226f52229edb3a1482c332ae6ca7 Mon Sep 17 00:00:00 2001 From: zpc Date: Wed, 24 Jul 2024 23:33:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/common.js | 839 +++++++++++++++------------ components/coupon-pop/coupon-pop.vue | 119 ++++ components/rule-pop/rule-pop.vue | 1 - package/index/lian-ji.vue | 6 + pages/mall/index.vue | 44 +- pages/shouye/detail.vue | 88 ++- pages/shouye/detail_wuxian.vue | 35 +- pages/shouye/index.vue | 21 +- pages/shouye/ranking.vue | 62 +- pages/user/my_coupon.vue | 49 +- pages/user/tui-guang.vue | 61 +- 11 files changed, 806 insertions(+), 519 deletions(-) create mode 100644 components/coupon-pop/coupon-pop.vue diff --git a/common/common.js b/common/common.js index 7cb60e3..a2ec4af 100644 --- a/common/common.js +++ b/common/common.js @@ -7,423 +7,504 @@ import Vue from 'vue' // 防止处理多次点击 function noMultipleClicks(methods, info) { - // methods是点击后需要执行的函数, info是函数需要传的参数 - let that = this - if (that.noClick) { - // 第一次点击 - that.noClick = false - if ((info && info !== '') || info == 0) { - // info是执行函数需要传的参数 - methods(info) - } else { - methods() - } - setTimeout(() => { - that.noClick = true - }, 2000) - } else { - // 这里是重复点击的判断 - } + // methods是点击后需要执行的函数, info是函数需要传的参数 + let that = this + if (that.noClick) { + // 第一次点击 + that.noClick = false + if ((info && info !== '') || info == 0) { + // info是执行函数需要传的参数 + methods(info) + } else { + methods() + } + setTimeout(() => { + that.noClick = true + }, 2000) + } else { + // 这里是重复点击的判断 + } } //导出 export default { - data: { - loading: false, - timer: null - }, + data: { + loading: false, + timer: null + }, - noMultipleClicks, // 禁止多次点击 + noMultipleClicks, // 禁止多次点击 - /* 获取日期 */ - getDateTime() { - const date = new Date() + /* 获取日期 */ + getDateTime() { + const date = new Date() - const year = date.getFullYear().toString() - const monty = (date.getMonth() + 1).toString() - const day = date.getDate().toString() + const year = date.getFullYear().toString() + const monty = (date.getMonth() + 1).toString() + const day = date.getDate().toString() - return `${year}-${monty}-${day}` - }, + return `${year}-${monty}-${day}` + }, - detailPageTitle(obj) { - if (!obj) { - return '' - } + detailPageTitle(obj) { + if (!obj) { + return '' + } - const types = { - 1: '一番赏', - 2: '无限赏', - 3: '擂台赏', - 4: '抽卡机', - 5: '积分赏', - 6: '全局赏', - 7: '福利盲盒', - 8: '领主赏', - 9: '连击赏' - } + const types = { + 1: '一番赏', + 2: '无限赏', + 3: '擂台赏', + 4: '抽卡机', + 5: '积分赏', + 6: '全局赏', + 7: '福利盲盒', + 8: '领主赏', + 9: '连击赏' + } - const target = types[obj.type] - return target - }, + const target = types[obj.type] + return target + }, - navTo(item) { - /* 领券中心 */ - if (item.ttype == 1) { - this.to({ - url: '/package/index/coupon-center', - query: { - coupon_id: item.coupon_id - } - }) - } + navTo(item) { + /* 领券中心 */ + if (item.ttype == 1) { + this.to({ + url: '/package/index/coupon-center', + query: { + coupon_id: item.coupon_id + } + }) + } - if (item.goods_id > 0) { - if (item.ttype == 2) { - /* 一番赏 */ - this.to({ - url: '/pages/shouye/detail', - query: { - goods_id: item.goods_id - } - }) - } + if (item.goods_id > 0) { + if (item.ttype == 2) { + /* 一番赏 */ + this.to({ + url: '/pages/shouye/detail', + query: { + goods_id: item.goods_id + } + }) + } - /* 无限赏 */ - if (item.ttype == 3) { - this.to({ - url: '/pages/shouye/detail_wuxian', - query: { - goods_id: item.goods_id - } - }) - } + /* 无限赏 */ + if (item.ttype == 3) { + this.to({ + url: '/pages/shouye/detail_wuxian', + query: { + goods_id: item.goods_id + } + }) + } - /* 连击赏 */ - if (item.ttype == 4) { - this.to({ - url: '/package/index/lian-ji', - query: { - goods_id: item.goods_id - } - }) - } - } - }, + /* 连击赏 */ + if (item.ttype == 4) { + this.to({ + url: '/package/index/lian-ji', + query: { + goods_id: item.goods_id + } + }) + } + } + }, - /** - * @description: 微信支付(小程序) - * @param {*} - * @return {*} - */ - wxMpPay({ provider = 'weixin', data }) { - console.log('wxdata', data) - // #ifdef H5 - console.log('进入h5支付', data) - return new Promise((resolve, reject) => { - WeixinJSBridge.invoke( - 'getBrandWCPayRequest', data, - function (res) { - console.log('支付回调', res); - if (res.errMsg == 'requestPayment:fail cancel') { - uni.showToast({ - title: '取消支付', - icon: 'none', - duration: 500, - success: () => { - /* 取消订单 */ - } - }) - resolve('cancel') - } - if (res.err_msg == "get_brand_wcpay_request:ok") { - // 使用以上方式判断前端返回,微信团队郑重提示: - //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 - uni.showToast({ - title: '支付成功', - icon: 'success', - duration: 500, - success: () => { - resolve('success') - } - }) - } + /** + * @description: 微信支付(小程序) + * @param {*} + * @return {*} + */ + wxMpPay({ + provider = 'weixin', + data + }) { + console.log('wxdata', data) + // #ifdef H5 + console.log('进入h5支付', data) + return new Promise((resolve, reject) => { + WeixinJSBridge.invoke( + 'getBrandWCPayRequest', data, + function(res) { + console.log('支付回调', res); + if (res.errMsg == 'requestPayment:fail cancel') { + uni.showToast({ + title: '取消支付', + icon: 'none', + duration: 500, + success: () => { + /* 取消订单 */ + } + }) + resolve('cancel') + } + if (res.err_msg == "get_brand_wcpay_request:ok") { + // 使用以上方式判断前端返回,微信团队郑重提示: + //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 + uni.showToast({ + title: '支付成功', + icon: 'success', + duration: 500, + success: () => { + resolve('success') + } + }) + } - }); + }); - }) + }) - // #endif - // #ifdef MP-WEIXIN - return new Promise((resolve, reject) => { - uni.requestPayment({ - provider, - ...data, - success: res => { - // console.log(res) - }, - fail: err => { - // console.log('common.wxMpPay-error', err) - }, - complete: res => { - console.log('complete (res)', res) - if (res.errMsg == 'requestPayment:fail cancel') { - this.toast({ - title: '取消支付', - icon: 'none', - duration: 500, - success: () => { - /* 取消订单 */ - } - }) + // #endif + // #ifdef MP-WEIXIN + return new Promise((resolve, reject) => { + uni.requestPayment({ + provider, + ...data, + success: res => { + // console.log(res) + }, + fail: err => { + // console.log('common.wxMpPay-error', err) + }, + complete: res => { + console.log('complete (res)', res) + if (res.errMsg == 'requestPayment:fail cancel') { + this.toast({ + title: '取消支付', + icon: 'none', + duration: 500, + success: () => { + /* 取消订单 */ + } + }) - resolve('cancel') - } - if (res.errMsg == 'requestPayment:ok') { - this.toast({ - title: '支付成功', - icon: 'success', - duration: 500, - success: () => { - resolve('success') - } - }) - } - } - }) - }) + resolve('cancel') + } + if (res.errMsg == 'requestPayment:ok') { + this.toast({ + title: '支付成功', + icon: 'success', + duration: 500, + success: () => { + resolve('success') + } + }) + } + } + }) + }) - // #endif - }, + // #endif + }, - /** - * @description: 规避连点 - * @param {*} - * @return {*} - */ - noDouble(fun, data, loading = false) { - /** - * $common.noDouble(fun,data) - * fun 需要规避连点的方法 - * data 该方法需要用到的参数 - * loading 接口加载中状态 - * 传入方法不要写括号 - */ + /** + * @description: 规避连点 + * @param {*} + * @return {*} + */ + noDouble(fun, data, loading = false) { + /** + * $common.noDouble(fun,data) + * fun 需要规避连点的方法 + * data 该方法需要用到的参数 + * loading 接口加载中状态 + * 传入方法不要写括号 + */ - /* 如果接口加载中,终止任何操作 */ - if (loading) { - setTimeout(() => { - uni.showToast({ - title: '请勿重复点击', - icon: 'none', - mask: false - }) - }, 100) - return - } + /* 如果接口加载中,终止任何操作 */ + if (loading) { + setTimeout(() => { + uni.showToast({ + title: '请勿重复点击', + icon: 'none', + mask: false + }) + }, 100) + return + } - /* 如果定时器未结束 */ - if (this.data.timer) { - setTimeout(() => { - uni.showToast({ - title: '请勿重复点击', - icon: 'none', - mask: false - }) - }, 100) + /* 如果定时器未结束 */ + if (this.data.timer) { + setTimeout(() => { + uni.showToast({ + title: '请勿重复点击', + icon: 'none', + mask: false + }) + }, 100) - /* 清除之前的定时器 */ - clearTimeout(this.data.timer) - /* 重新设置定时器 */ - this.data.timer = setTimeout(() => { - this.data.timer = null - }, 200) - return - } + /* 清除之前的定时器 */ + clearTimeout(this.data.timer) + /* 重新设置定时器 */ + this.data.timer = setTimeout(() => { + this.data.timer = null + }, 200) + return + } - console.log(data && data) + console.log(data && data) - /* 设置第一次点击的定时器 */ - this.data.timer = setTimeout(() => { - this.data.timer = null - }, 200) + /* 设置第一次点击的定时器 */ + this.data.timer = setTimeout(() => { + this.data.timer = null + }, 200) - /* 如果有回调,使用回调并传入参数 */ - fun && fun(data && data) - }, + /* 如果有回调,使用回调并传入参数 */ + fun && fun(data && data) + }, - /** - * @description: tost提示 - * @return {*} - */ - toast(opt) { - let title = opt.title || '' - let icon = opt.icon || 'none' - let mask = opt.mask || false - let duration = opt.duration || 1500 - let position = opt.position || 'center' + /** + * @description: tost提示 + * @return {*} + */ + toast(opt) { + let title = opt.title || '' + let icon = opt.icon || 'none' + let mask = opt.mask || false + let duration = opt.duration || 1500 + let position = opt.position || 'center' - setTimeout(() => { - uni.showToast({ - title, - icon, - mask, - duration, - position, - success: () => { - if (opt.success) { - setTimeout(() => { - opt.success() - }, duration) - } - } - }) - }, 100) - }, + setTimeout(() => { + uni.showToast({ + title, + icon, + mask, + duration, + position, + success: () => { + if (opt.success) { + setTimeout(() => { + opt.success() + }, duration) + } + } + }) + }, 100) + }, - /** - * @description: 获取规则 - * @param {*} type - * @return {*} - */ - getRule(id = '', loading = false) { - return new Promise((resolve, reject) => { - Vue.prototype.req({ - url: 'danye', - Loading: !loading, - data: { - type: id - }, - success: res => { - if (res.status == 1) { - if (res.data) { - res.data = res.data.replace( - /\ { + Vue.prototype.req({ + url: 'danye', + Loading: !loading, + data: { + type: id + }, + success: res => { + if (res.status == 1) { + if (res.data) { + res.data = res.data.replace( + /\ `${key}=${value}`) - .join('&') - return `?${str}` - }, + /** + * @description: obj转为queryString + * @param {*} e + * @return {*} + */ + qs(e) { + let str = Object.entries(e) + .map(([key, value]) => `${key}=${value}`) + .join('&') + return `?${str}` + }, - /** - * @description: 跳转页面 - * @param {*} type 跳转类型 1 navigate,2 redirect,3 switch,4 relaunch - * @param {*} url - * @param {*} query - * @return {*} - */ - to({ type = 1, url, query = {}, success, fail, complete }) { - if (!url) { - this.toast({ - title: '暂未开放' - }) - return - } + /** + * @description: 跳转页面 + * @param {*} type 跳转类型 1 navigate,2 redirect,3 switch,4 relaunch + * @param {*} url + * @param {*} query + * @return {*} + */ + to({ + type = 1, + url, + query = {}, + success, + fail, + complete + }) { + if (!url) { + this.toast({ + title: '暂未开放' + }) + return + } - if (Object.keys(query).length > 0) { - url += this.qs(query) - } + if (Object.keys(query).length > 0) { + url += this.qs(query) + } - const opt = { - url, - success, - fail, - complete - } + const opt = { + url, + success, + fail, + complete + } - const dic = { - 1: uni.navigateTo, - 2: uni.redirectTo, - 3: uni.switchTab, - 4: uni.reLaunch - } + const dic = { + 1: uni.navigateTo, + 2: uni.redirectTo, + 3: uni.switchTab, + 4: uni.reLaunch + } - const action = dic[type] + const action = dic[type] - action(opt) - }, + action(opt) + }, - /** - * @description: 返回上一页 - * @param {*} e - * @return {*} - */ - back(e) { - /* 判断传入的是否是数字 */ - let pages = getCurrentPages() - console.log('pgaes', pages) - if (pages.length >= 2) { - if (typeof e === 'number' && !isNaN(e)) { - /* 如果要跳转的长度小于页面栈数量 */ - if (e < pages.length) { - uni.navigateBack({ delta: e }) - /* 否则回首页 */ - } else { - uni.switchTab({ url: '/pages/shouye/index' }) - } - /* 默认返回上一级 */ - } else { - uni.navigateBack({ delta: 1 }) - } - } else { - uni.switchTab({ url: '/pages/shouye/index' }) - } - }, + /** + * @description: 返回上一页 + * @param {*} e + * @return {*} + */ + back(e) { + /* 判断传入的是否是数字 */ + let pages = getCurrentPages() + console.log('pgaes', pages) + if (pages.length >= 2) { + if (typeof e === 'number' && !isNaN(e)) { + /* 如果要跳转的长度小于页面栈数量 */ + if (e < pages.length) { + uni.navigateBack({ + delta: e + }) + /* 否则回首页 */ + } else { + uni.switchTab({ + url: '/pages/shouye/index' + }) + } + /* 默认返回上一级 */ + } else { + uni.navigateBack({ + delta: 1 + }) + } + } else { + uni.switchTab({ + url: '/pages/shouye/index' + }) + } + }, - /** - * @description: 提取富文本文字 - * @param {*} val - * @return {*} - */ - filterText(val) { - if (val) { - var replaceLbael = val.replace(/<[^>]+>/g, '') - return replaceLbael.replace(/ /ig, '') - } else { - return '' - } - }, - // 返回上一页 - $navBack(num = 1, time = 0) { - // 页面返回 - setTimeout(() => { - uni.navigateBack({ - delta: num, - fail: () => { - uni.reLaunch({ - url: '/pages/shouye/index' - }) - } - }) - }, time * 1000) - }, -} + /** + * @description: 提取富文本文字 + * @param {*} val + * @return {*} + */ + filterText(val) { + if (val) { + var replaceLbael = val.replace(/<[^>]+>/g, '') + return replaceLbael.replace(/ /ig, '') + } else { + return '' + } + }, + // 返回上一页 + $navBack(num = 1, time = 0) { + // 页面返回 + setTimeout(() => { + uni.navigateBack({ + delta: num, + fail: () => { + uni.reLaunch({ + url: '/pages/shouye/index' + }) + } + }) + }, time * 1000) + }, + /** + * 分享 + * @param {Object} title + * @param {Object} desc + * @param {Object} link + * @param {Object} image + */ + $fenxiang(title, desc, link, image) { + // #ifdef H5 + Vue.prototype.req({ + url: 'getAccessTokenOffiaccountSign', + data: { + url: location.href.split('#')[0] + }, + success: res => { + console.log(res); + if (res.status == 1) { + let _data = res.data; + wx.config({ + debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 + appId: _data.appId, + timestamp: _data.timestamp, + nonceStr: _data.noncestr, + signature: _data.signature, + jsApiList: [ + 'checkJsApi', + 'updateAppMessageShareData', + ] + }); + wx.ready(function() { + wx.checkJsApi({ + jsApiList: [ + 'openAddress', + ], + success: function(res) { + if (link.indexOf('http:') < 0 && link.indexOf( + 'https:') < 0) { + link = location.href.split('#')[0] + link; + } + + wx.updateAppMessageShareData({ + title: title, // 分享标题 + desc: desc, // 分享描述 + link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 + imgUrl: image, // 分享图标 + success: function() { + // 设置成功 + } + }) + } + }); + + + }); + wx.error(function(res) { + // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。 + console.log("出现错误", res); + }); + } + } + }) + // #endif + } +} \ No newline at end of file diff --git a/components/coupon-pop/coupon-pop.vue b/components/coupon-pop/coupon-pop.vue new file mode 100644 index 0000000..442fa5d --- /dev/null +++ b/components/coupon-pop/coupon-pop.vue @@ -0,0 +1,119 @@ + + + + + + \ No newline at end of file diff --git a/components/rule-pop/rule-pop.vue b/components/rule-pop/rule-pop.vue index e8794de..1664333 100644 --- a/components/rule-pop/rule-pop.vue +++ b/components/rule-pop/rule-pop.vue @@ -84,7 +84,6 @@ export default { async getRule(id, title = '') { let res = await this.$c.getRule(id, true) - this.open({ title: title, content: res.data diff --git a/package/index/lian-ji.vue b/package/index/lian-ji.vue index 2422e02..c42501e 100644 --- a/package/index/lian-ji.vue +++ b/package/index/lian-ji.vue @@ -446,6 +446,7 @@ + @@ -896,6 +897,11 @@ close(e) { this.$refs[e].close() + if (e == "resPop") { + if (this.prizeData['user_coupon'] != null) { + this.$refs["couponPop"].open(this.prizeData['user_coupon']); + } + } }, open(e) { diff --git a/pages/mall/index.vue b/pages/mall/index.vue index 00f46bc..d3c2b0e 100644 --- a/pages/mall/index.vue +++ b/pages/mall/index.vue @@ -5,14 +5,27 @@ 商城好物 - + + + + - - + + @@ -142,6 +155,7 @@ return { statusBarHeight: 0, datas: [], + advert: [], sendRuleData: '', goodsId: "", orderData: null, @@ -161,7 +175,7 @@ }); this.getData(); - + this.load(); this.$c.getRule(10).then(res => { if (res.status == 1) { this.sendRuleData = res.data @@ -178,6 +192,18 @@ } }, methods: { + load() { + let that = this + that.req({ + url: 'getAdvert?type_id=3', + success(res) { + if (res.status == 1) { + that.advert = res.data + } + } + }) + + }, getStatusBarHeight() { const systemInfo = uni.getSystemInfoSync(); this.statusBarHeight = systemInfo.statusBarHeight; @@ -301,7 +327,7 @@ if (type == 1) { that.close('pop') if (res.data.status == 1) { - + const status = await that.$c.wxMpPay({ data: res.data.res }) @@ -309,10 +335,10 @@ // that.getPrize(res.data.order_num) that.getData(); } - - - + + + } else { that.$c.toast({ title: res.msg, diff --git a/pages/shouye/detail.vue b/pages/shouye/detail.vue index 98abad0..d894f27 100644 --- a/pages/shouye/detail.vue +++ b/pages/shouye/detail.vue @@ -42,8 +42,10 @@ - - + + @@ -91,7 +93,9 @@ - {{ item.shang_info?item.shang_info.title:'' }} + + {{ item.shang_info?item.shang_info.title:'' }} {{ item.surplus_stock }}/{{ item.stock }} 预售 @@ -140,7 +144,8 @@ - {{item.shang_title}} + + {{item.shang_title}} {{ item.goodslist_title }} @@ -200,7 +205,8 @@ - {{previewData.shang_info.title}} + {{previewData.shang_info.title}} + @@ -297,7 +303,7 @@ ? `-${couponData.price}` : '未选择' }} - + @@ -458,6 +464,7 @@ + @@ -836,7 +843,7 @@ num, size }) { - if(num>1) return this.mescroll.endByPage(this.logList.length, 1) + if (num > 1) return this.mescroll.endByPage(this.logList.length, 1) this.req({ url: 'shang_log', data: { @@ -887,6 +894,11 @@ close(e) { this.$refs[e].close() + if (e == "resPop") { + if (this.prizeData['user_coupon'] != null) { + this.$refs["couponPop"].open(this.prizeData['user_coupon']); + } + } }, open(e) { @@ -944,7 +956,7 @@ color: #FFFFFF; background: #3B3941; border-radius: 8rpx 8rpx 8rpx 8rpx; - border: 2rpx solid rgba(255,255,255,0.27); + border: 2rpx solid rgba(255, 255, 255, 0.27); } &:last-child { @@ -1001,7 +1013,8 @@ padding-left: 60rpx; display: flex; align-items: center; - .prize-shang{ + + .prize-shang { height: 40rpx; padding: 0 20rpx; // background: #B07AF3; @@ -1011,6 +1024,7 @@ font-size: 24rpx; color: #FFFFFF; } + .pic { width: 80rpx; height: 80rpx; @@ -1039,11 +1053,12 @@ .header { width: 750rpx; height: 722rpx; - &-wuzhe{ + + &-wuzhe { width: 160rpx; height: 60rpx; position: absolute; - top:300rpx; + top: 300rpx; left: 0; } @@ -1116,8 +1131,8 @@ color: #000000; } } - - &-shoucang{ + + &-shoucang { width: 120rpx; height: 64rpx; position: absolute; @@ -1125,12 +1140,14 @@ bottom: 140rpx; box-sizing: border-box; background: url($imgurl+'/common/shoucang.png') no-repeat 0 0 / 100% 100%; - >image{ + + >image { width: 28rpx; height: 28rpx; margin-top: 22rpx; } - >text{ + + >text { font-weight: 400; font-size: 24rpx; color: #FFFFFF; @@ -1320,7 +1337,7 @@ .yu-tag { position: absolute; right: 10rpx; - top: 10rpx; + top: 10rpx; z-index: 1; display: flex; justify-content: center; @@ -1457,18 +1474,20 @@ position: relative; width: 570rpx; box-sizing: border-box; - + .pic { width: 570rpx; height: 598rpx; // background: #8953DC; background: #FFFFFF; border: 2rpx solid #FFFFFF; - >image{ + + >image { width: 548rpx; height: 549rpx; } - >view{ + + >view { width: 130rpx; height: 46rpx; position: absolute; @@ -1481,7 +1500,7 @@ background: url($imgurl+'common/chouLabel.png') no-repeat 0 0 / 100% 100%; } } - + .title { margin: 40rpx auto 0; width: 574rpx; @@ -1495,30 +1514,30 @@ border: 2rpx solid #894DD3; border-radius: 12rpx; background: #313133; - + >text { font-weight: 400; font-size: 32rpx; color: #FFFFFF; } } - + .d-list { display: flex; flex-flow: row wrap; justify-content: space-between; padding: 20rpx 0 0; - + .d-item { margin-top: 14rpx; - + font-size: 24rpx; font-family: Source Han Sans CN; font-weight: 400; color: #ffffff; } } - + .close { width: 48rpx; height: 48rpx; @@ -1732,11 +1751,13 @@ justify-content: center; font-weight: 500; color: #7825DE; - >text:nth-child(1){ + + >text:nth-child(1) { font-size: 28rpx; margin-top: 32rpx; } - >text:nth-child(2){ + + >text:nth-child(2) { font-size: 36rpx; margin-top: 26rpx; } @@ -1775,7 +1796,8 @@ position: relative; background: #8953DC; border: 2rpx solid #FFFFFF; - >image{ + + >image { width: 202rpx; height: 202rpx; } @@ -1807,6 +1829,7 @@ text-shadow: #000 1rpx 0 0, #000 0 1rpx 0, #000 -1rpx 0 0, #000 0 -1rpx 0; } } + .title { padding: 10rpx 10rpx 0; font-weight: 400; @@ -1834,14 +1857,17 @@ height: 116rpx; font-weight: 400; font-size: 28rpx; - >text{ + + >text { margin-top: 36rpx; } } - >view:nth-child(1){ + + >view:nth-child(1) { color: #DE6025; } - >view:nth-child(2){ + + >view:nth-child(2) { color: #7825DE; } } diff --git a/pages/shouye/detail_wuxian.vue b/pages/shouye/detail_wuxian.vue index a047bbd..05b3ccf 100644 --- a/pages/shouye/detail_wuxian.vue +++ b/pages/shouye/detail_wuxian.vue @@ -184,8 +184,8 @@ --> - + - + @@ -528,6 +528,7 @@ + @@ -535,6 +536,7 @@ export default { data() { return { + userCoupon: null, optData: '', buyNum: 0, useMoney: true, @@ -631,6 +633,7 @@ // this.aniSrc = path // } // }) + //$refs.rulePop.getRule(pageData.danye_id, '购买说明') this.$c.getRule(10).then(res => { if (res.status == 1) { @@ -667,7 +670,7 @@ this.$refs.bossScroll.mescroll.resetUpScroll() this.$refs.bossScroll.mescroll.scrollTo(0, 0) }, - + previewDetail(item, a) { const obj = { imgurl: a.imgurl, @@ -932,7 +935,7 @@ num, size }) { - if(num>1) return this.mescroll.endByPage(this.logList.length, 1) + if (num > 1) return this.mescroll.endByPage(this.logList.length, 1) this.req({ url: 'infinite_shang_log', data: { @@ -988,6 +991,11 @@ close(e) { this.$refs[e].close() + if (e == "resPop") { + if (this.prizeData['user_coupon'] != null) { + this.$refs["couponPop"].open(this.prizeData['user_coupon']); + } + } }, open(e) { @@ -1001,6 +1009,14 @@ }) } + // if (e == "resPop") { + // this.$nextTick(() => { + // setTimeout(() => { + // this.$refs["couponPop"].open() + // }, 200) + // }) + // } + if (e == 'playPop') { this.$c.getRule(14).then(res => { if (res.status == 1) { @@ -1183,11 +1199,12 @@ .header { width: 750rpx; height: 722rpx; - &-wuzhe{ + + &-wuzhe { width: 160rpx; height: 60rpx; position: absolute; - top:300rpx; + top: 300rpx; left: 0; } @@ -1499,7 +1516,7 @@ .goods-list { padding: 30rpx 0rpx 0; display: grid; - grid-template-columns: repeat(3,220rpx); + grid-template-columns: repeat(3, 220rpx); grid-gap: 20rpx; .goods-item { diff --git a/pages/shouye/index.vue b/pages/shouye/index.vue index 662e72e..56f6171 100644 --- a/pages/shouye/index.vue +++ b/pages/shouye/index.vue @@ -32,17 +32,20 @@ - - + + :src="$img1('/image/a6548-pw1cx.webp')"> - - - + style="position: absolute; width: 585rpx; height: 230rpx; margin-left: 85rpx; display: flex; flex-direction: row; align-items: center; justify-content: space-between;overflow: auto;"> + + + + + @@ -233,6 +236,7 @@ } }, advert: [], //轮播图 + tuijian: [], //推荐上新 notice_list: [], // 弹幕 erweima: '', // 福利群 yushou_rili: '', // 预售日历 @@ -408,6 +412,7 @@ success(res) { if (res.status == 1) { that.advert = res.data.advert + that.tuijian = res.data.tuijian; that.notice_list = res.data.new_bulletcha that.erweima = res.data.other.erweima that.gonggao = res.data.notice.content diff --git a/pages/shouye/ranking.vue b/pages/shouye/ranking.vue index fe174d5..d5791dc 100644 --- a/pages/shouye/ranking.vue +++ b/pages/shouye/ranking.vue @@ -4,27 +4,40 @@ 排行榜 - - - 55555555 + + + + + + - - - + + + + + + + + + + + + {{index}} - + - 昵称昵称 - ID:1234567 + {{item.nickname}} + ID:{{item.user_id}} - - 99999 + {{item.price}} @@ -38,11 +51,34 @@ data() { var list; return { - list: [1, 2, 3, 4, 5], + advert: [], //轮播图 + list: [], } }, + onLoad() { + this.load(); + }, methods: { - + load() { + let that = this + that.req({ + url: 'getAdvert?type_id=4', + success(res) { + if (res.status == 1) { + that.advert = res.data + } + } + }) + that.req({ + url: 'record', + success(res) { + console.log(res); + if (res.status == 1) { + that.list = res.data.list + } + } + }) + } } } diff --git a/pages/user/my_coupon.vue b/pages/user/my_coupon.vue index 6913c93..c64c426 100644 --- a/pages/user/my_coupon.vue +++ b/pages/user/my_coupon.vue @@ -22,7 +22,8 @@ - + {{ item.title }} @@ -46,8 +47,8 @@ 需要{{ item.kl_num2 }}个参与者 - @@ -107,8 +107,14 @@