From fcbf48f657ab3f1ef4cef7127930a05b5729ced1 Mon Sep 17 00:00:00 2001 From: shuxiaoquan <853623962@qq.com> Date: Tue, 27 Feb 2024 14:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E4=BB=A5=E5=8F=8A=E8=A7=84=E5=88=99=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E4=BA=BAid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/goods/index.js | 5 + pages.json | 5 + pages/activity/presale.vue | 2 +- pages/activity/presaleRule.vue | 31 +-- pages/activity/seckill.vue | 8 +- pages/goods/detail.vue | 225 ++++++++++++++++---- pages/index/index.vue | 11 +- pages/invite/index.vue | 7 +- pages/invite/rule.vue | 48 +++++ pages/login/components/mp-weixin-mobile.vue | 4 +- pages/login/index.vue | 8 +- pages/news1/jinqun.vue | 61 +++++- pages/user/index.vue | 1 + 13 files changed, 332 insertions(+), 84 deletions(-) create mode 100644 pages/invite/rule.vue diff --git a/api/goods/index.js b/api/goods/index.js index e18fa53..22fa832 100644 --- a/api/goods/index.js +++ b/api/goods/index.js @@ -14,6 +14,11 @@ const api = { presale:'goods/presale' } +// 商品价格修改 +export const editPrice = (param, option) => { + return request.get('StoreKeeper/editPrice', param, option) +} + // 商品浏览记录 export const browseHistoryList = (param, option) => { return request.get('goods/browseLog', param, option) diff --git a/pages.json b/pages.json index 6d1427d..5dbf9f1 100644 --- a/pages.json +++ b/pages.json @@ -99,6 +99,11 @@ "style": { "navigationBarTitleText": "邀请记录" } + },{ + "path": "pages/invite/rule", + "style": { + "navigationBarTitleText": "邀请规则" + } }, { "path": "pages/custom/index", diff --git a/pages/activity/presale.vue b/pages/activity/presale.vue index 5a785cb..0e8ef0d 100644 --- a/pages/activity/presale.vue +++ b/pages/activity/presale.vue @@ -58,7 +58,7 @@ methods: { goPre(item) { uni.navigateTo({ - url: '/pages/goods/detail?goodsId=' + item.goods_id + '&isPre=' + true+'&pre_id='+this.info.id + url: '/pages/goods/detail?goodsId=' + item.goods_id + '&isPre=' + true+'&pre_id='+this.info.id+'&isBuy='+this.info.end_time }) }, openPage() { diff --git a/pages/activity/presaleRule.vue b/pages/activity/presaleRule.vue index 6e31618..13cf2e9 100644 --- a/pages/activity/presaleRule.vue +++ b/pages/activity/presaleRule.vue @@ -1,13 +1,11 @@ <template> <view class="presale"> - <view class="p"> - <image :src="content"></image> - </view> + <view class="p" v-html="content"></view> </view> </template> <script> - import * as Api from '@/api/activity' + import * as Api from '@/api/help' export default { data() { return { @@ -27,11 +25,15 @@ // 获取预售规则 getCarouselList(type) { const app = this; - Api.getImage({ - type: type + Api.getAgreement({ + type: type==5?'presale_rule':"rank_rule" }) .then(result => { - this.content = result.data.imgurl[0] + let content = result.data.detail.content; + if(content){ + content = content.replace(/style=""/g,'').replace(/<img src=/g,'<img style="width: 100%; display:block" src=') + } + this.content = content }) .finally(() => app.isLoading = false) }, @@ -41,21 +43,10 @@ <style lang="scss" scoped> .presale { - height: 100vh; - background-color: #fff; - padding: 0 40rpx; - overflow-y: auto; - - .title { - padding: 40rpx 0; - font-size: 32rpx; - font-weight: 500; - color: #000000; - } - + padding: 40rpx; .p { font-size: 26rpx; - line-height: 46rpx; + line-height: 50rpx; color: #212121; } } diff --git a/pages/activity/seckill.vue b/pages/activity/seckill.vue index 836107f..16200ff 100644 --- a/pages/activity/seckill.vue +++ b/pages/activity/seckill.vue @@ -25,7 +25,7 @@ <view class="over" v-if="tabbar.length"> <view class="info"> 距秒杀<text - class="m-r-10">{{ tabbar[curTabIndex].status == ActiveStatusEnum.STATE_BEGIN.value ? '距结束' : '距开始' }}</text>还剩 + class="m-r-10">{{ tabbar[curTabIndex].status == ActiveStatusEnum.STATE_BEGIN.value ? '结束' : '开始' }}</text>还剩 <count-down style='display: inline-block;' :date="tabbar[curTabIndex].count_down_time" separator="colon" theme="custom" /> </view> @@ -167,7 +167,7 @@ }) } app.curTabIndex = 0 - if (!app.goodsList.data.length) { + if (!app.goodsList.length) { app.mescroll.showEmpty() } resolve() @@ -244,11 +244,13 @@ // 跳转到秒杀商品详情 handleTargetGoods(sharpGoodsId) { + let count_down_time = new Date(this.tabbar[this.curTabIndex].count_down_time.replace(/-/g, '/')).getTime()-new Date().getTime() uni.navigateTo({ - url: '/pages/goods/detail?goodsId=' + sharpGoodsId + url: '/pages/goods/detail?goodsId=' + sharpGoodsId+"&isSeckill="+true+'&isBuy='+count_down_time+'&seckillText='+(this.tabbar[this.curTabIndex].status == this.ActiveStatusEnum.STATE_BEGIN.value ? '结束' : '开始' ) }) }, + // 设置微信公众号链接分享卡片内容 setWxofficialShareData() { this.updateShareCardData({ diff --git a/pages/goods/detail.vue b/pages/goods/detail.vue index 5689b4f..303eab9 100644 --- a/pages/goods/detail.vue +++ b/pages/goods/detail.vue @@ -72,8 +72,8 @@ <image :src="$picUrl+'/static/detail/copy.png'"></image> </view> <view class="operaImg"> - <image :src="$picUrl+'/static/detail/jiangjia.png'" class="tips"></image> - <image :src="$picUrl+'/static/detail/tip.png'" class="tips"></image> + <image :src="$picUrl+'/static/detail/miaosha.png'" v-if="isSeckill" class="tips"></image> + <image :src="$picUrl+'/static/detail/tip.png'" @click="toJDdetal(goods.goods_id)" class="tips"></image> <image :src="$picUrl+'/static/detail/ys.png'" class="tips"></image> </view> </view> @@ -200,32 +200,77 @@ </view> </view> - <view class="fooRight"> + <view class="fooRight" v-if="isLogin && userInfo.user_type == 40"> <template v-if="goods.status == 20"> <view class="btn-bg"> 已下架 </view> </template> <template v-else> - <template v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num == 0"> + <view class="btn-bg" style="background-color: #FF1D1D;" @click="openPirce()"> + 修改价格 + </view> + </template> + </view> + + <view class="fooRight" v-else> + <template v-if="goods.status == 20"> <view class="btn-bg"> - 暂无库存 + 已下架 </view> </template> <template v-else> - <view class="addCar" v-if="!isPre" @click="choseSku(2)"> - 加入购物车 - </view> - <view class="buyNow" v-if="!isPre" @click="choseSku(3)"> - 立即购买 - </view> - <view class="buyNow" @click="onReservation()" v-if="isPre"> - 立即预约 - </view> + <template v-if="goods.skuList && goods.skuList.length > 0 && goods.skuList[0].stock_num == 0"> + <view class="btn-bg"> + 暂无库存 + </view> + </template> + <template v-else> + <template v-if="!isPre"> + <template v-if="isSeckill"> + <template v-if="isBuy"> + <template v-if="seckillText=='距离'"> + <view class="addCar" @click="choseSku(2)"> + 加入购物车 + </view> + <view class="buyNow" @click="choseSku(3)"> + 立即购买 + </view> + </template> + <template v-else> + <view class="btn-bg"> + 未到时间 + </view> + </template> + </template> + <template v-else> + <view class="btn-bg"> + 已下架 + </view> + </template> + </template> + <template v-else> + <view class="addCar" @click="choseSku(2)"> + 加入购物车 + </view> + <view class="buyNow" @click="choseSku(3)"> + 立即购买 + </view> + </template> + </template> + <template v-if="isPre"> + <view class="buyNow" @click="onReservation()" v-if="isBuy > 0"> + 立即预约 + </view> + <view class="btn-bg" v-else> + 已失效 + </view> + </template> + </template> </template> - </template> - </view> - + </view> + + </view> <view class="dia" v-if="openDialog"> <view class="preSuc" v-if="shareType=='pre'"> @@ -238,8 +283,59 @@ <view class="iKnow" @click="onKonw"> 查看预约记录 </view> + </view> + <view class="setMs" v-if="shareType=='setPrice'"> + <view class="msprice"> + 设置商品价格 + </view> + <view class="msLine"> + <u-line class="u-line"></u-line> + </view> + <view class="msp"> + <text>商品价:</text> + <input type="text" disabled v-model="goods.goods_price_min" placeholder="最高价" class="inp" /> + </view> + <view class="msp"> + <text>最高价:</text> + <input type="text" v-model="max_price" placeholder="最高价" class="inp" /> + </view> + <view class="msp"> + <text>加价率:</text> + <input type="text" v-model="markup_rate" placeholder="加价率" class="inp" /> + </view> + <!-- <view class="qj"> + <text class="msQj">秒杀区间:</text> + <view class="date"> + <view class="beginTime timeCommn"> + 开始时间 + </view> + - + <view class="timeCommn endTime"> + 结束时间 + </view> + </view> + </view> --> + <!-- <view class="msLimit"> + <text>秒杀限购:</text> + <switch @change="switch1Change" /> + </view> + <view class="peoLimit"> + <text>每人限购</text> + <view class="num"> + 1 + </view> + <text>次</text> + </view> --> + <view class="operaBtn"> + <view class="cancel btnComm" @click="shareCancel()"> + 取消 + </view> + <view class="sureBtn btnComm" @click="toUnpdatePrice()"> + 确定 + </view> + </view> </view> - <view class="setMs" v-if="shareType=='setPrice'"> + <!-- <view class="setMs" v-if="shareType=='setPrice'"> <view class="msprice"> 设置秒杀价格 </view> @@ -281,7 +377,7 @@ 确定 </view> </view> - </view> + </view> --> <!-- --> <view class="shareWechat" v-if="shareType=='share'"> <view class="shareGoods"> @@ -348,6 +444,8 @@ }, data() { return { + max_price: "", + markup_rate: "", showGoodsPosterPopup: false, cityInfo: {}, currenIndex: 0, @@ -361,8 +459,11 @@ skuMode: 1, diaShow: false, searchValue: '', - isPre: false, - pre_id: '', + isPre: false, //是否预售 + pre_id: '', //预售id + isBuy: "",//是否购买 + isSeckill: false,//是否秒杀 + seckillText: "",//是否秒杀 setPrice: false, openDialog: false, goodsId: '', @@ -384,7 +485,11 @@ console.log(options,"oo") this.isPre = options.isPre?options.isPre:null this.goodsId = options.goodsId?options.goodsId:null - this.pre_id = options.pre_id?options.pre_id:null; + this.pre_id = options.pre_id?options.pre_id:null; + this.isSeckill = options.isSeckill?options.isSeckill:null; + this.isBuy = options.isBuy?decodeURIComponent(options.isBuy):null; + this.seckillText = options.seckillText?decodeURIComponent(options.seckillText):null; + console.log(this.isBuy) this.getSuggestGoods() this.getServeList() this.getGoodsDetail() @@ -408,6 +513,58 @@ } }, methods: { + //修改商品价格 + async toUnpdatePrice(){ + const that = this; + if(!that.max_price){ + uni.showToast({ + icon: "none", + title: "最高价不能为空!" + }) + return ; + } + if(!that.markup_rate){ + uni.showToast({ + icon: "none", + title: "加价率不能为空!" + }) + return ; + } + let params={ + id: that.goods.goods_id, + max_price: that.max_price, + markup_rate: that.markup_rate, + cat_id: that.goods.category.category_id, + type: 3 + } + GoodsApi.editPrice(params).then(res => { + if (res.status == 200) { + that.shareCancel(); + that.$toast("修改成功"); + setTimeout(()=>{ + that.getGoodsDetail(); + },1000) + } + }) + .catch() + }, + //跳转京东小程序详情 + toJDdetal(sku) { + wx.navigateToMiniProgram({ + appId: 'wx91d27dbf599dff74', + path: '/pages/item/detail/detail?sku='+sku, + envVersion: 'release', + success(res) { + // 打开成功 + console.log(res); + } + }) + }, + //修改价格 + openPirce() { + this.openDialog = true; + this.shareType= 'setPrice' + }, //门店图片预览 previewImage(i){ uni.previewImage({ @@ -427,7 +584,8 @@ shareImg(){ this.openDialog =true this.shareType= 'share' - }, + }, + //立即预约 preNow(){ const that = this let params={ @@ -712,23 +870,6 @@ this.openDialog = false this.showGoodsPosterPopup = true; } - // - // // 获取商品信息 - // getGoodsDetail() { - // const app = this - // return new Promise((resolve, reject) => { - // GoodsApi.poster({ - // goodsId: app.goodsId, - // channel: "微信小程序" - // }) - // .then(result => { - // app.imageUrl = result.data.imageUrl - // resolve(result) - // }) - // .catch(reject) - // }) - // }, - // }, }, }, /** @@ -1365,7 +1506,7 @@ } .buyNow { - width: 212rpx; + flex: 1; height: 78rpx; background: linear-gradient(102deg, #FE5E06 0%, #F3221A 100%); border-radius: 42rpx 42rpx 42rpx 42rpx; @@ -1453,7 +1594,7 @@ .setMs { width: 656rpx; - height: 690rpx; + height: 590rpx; background: #FFFFFF; border-radius: 12rpx 12rpx 12rpx 12rpx; opacity: 1; diff --git a/pages/index/index.vue b/pages/index/index.vue index 94d09c1..a4775d5 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -140,7 +140,7 @@ </view> </view> <view class="goods-list"> - <view class="list" v-for="(item, index) in seckillList" :key="index" @click="goJump('/pages/goods/detail?goodsId=' + item.goods_id)"> + <view class="list" v-for="(item, index) in seckillList" :key="index" @click="handleTargetGoods(item.goods_id)"> <view class="pictrue"> <image :src="item.goods_image"></image> </view> @@ -486,12 +486,20 @@ serveList: [], couList: [], timeData: {}, + tabbar: [], + curTabIndex: 0 } }, methods:{ onChangeSeckillCutDownTime(e){ this.timeData = e }, + // 跳转到秒杀商品详情 + handleTargetGoods(sharpGoodsId) { + uni.navigateTo({ + url: '/pages/goods/detail?goodsId=' + sharpGoodsId+"&isSeckill="+true+'&isBuy='+this.seckillCutDownTime+'&seckillText='+(this.tabbar[this.curTabIndex].status == 10 ? '结束' : '开始' ) + }) + }, //跳转会话列表 toChat() { if(!uni.getStorageSync("AccessToken")){ @@ -636,6 +644,7 @@ this.seckillList = [] limit.data().then(result => { let seckillList = []; + this.tabbar = result.data.tabbar if(result.data.tabbar && result.data.tabbar.length > 0){ let count_down_time = result.data.tabbar[0].count_down_time.replace(/-/g, '/'); this.seckillCutDownTime = Math.ceil((new Date(count_down_time).getTime() - new Date().getTime())); diff --git a/pages/invite/index.vue b/pages/invite/index.vue index 7a18ece..2cf124f 100644 --- a/pages/invite/index.vue +++ b/pages/invite/index.vue @@ -6,7 +6,7 @@ <view class="invite-hd"> <image :src="$picUrl+'/static/news/invite-bg.png'"></image> <view class="btn"></view> - <view class="rule"></view> + <view class="rule" @click="openPage(4)"></view> </view> <view class="invite-bd"> <view class="invite-bd-a"> @@ -194,6 +194,11 @@ }else if(index == 3){ this.isPopup = true; this.InviteUserPoster(); + }else if(index == 4){ + uni.navigateTo({ + url: "/pages/invite/rule" + }) + } }, } diff --git a/pages/invite/rule.vue b/pages/invite/rule.vue new file mode 100644 index 0000000..82fd47d --- /dev/null +++ b/pages/invite/rule.vue @@ -0,0 +1,48 @@ +<template> + <view class="presale"> + <view class="p" v-html="content"></view> + </view> +</template> + +<script> + import * as Api from '@/api/help' + export default { + data() { + return { + content: '' + } + }, + onLoad(op) { + this.getCarouselList() + }, + onShow() {}, + methods: { + // 获取预售规则 + getCarouselList(type) { + const app = this; + Api.getAgreement({ + type: 'invite_rule' + }) + .then(result => { + let content = result.data.detail.content; + if(content){ + content = content.replace(/style=""/g,'').replace(/<img src=/g,'<img style="width: 100%; display:block" src=') + } + this.content = content + }) + .finally(() => app.isLoading = false) + }, + } + } +</script> + +<style lang="scss" scoped> + .presale { + padding: 40rpx; + .p { + font-size: 26rpx; + line-height: 50rpx; + color: #212121; + } + } +</style> diff --git a/pages/login/components/mp-weixin-mobile.vue b/pages/login/components/mp-weixin-mobile.vue index 2fd3d0c..401fab9 100644 --- a/pages/login/components/mp-weixin-mobile.vue +++ b/pages/login/components/mp-weixin-mobile.vue @@ -20,7 +20,7 @@ export default { props: { // 分享人id - share_user_id: { + refereeId: { type: String }, }, @@ -65,7 +65,7 @@ code: app.code, encryptedData: detail.encryptedData, iv: detail.iv, - share_user_id: this.share_user_id, + refereeId: this.refereeId, isParty: app.isParty, partyData: app.userInfo, refereeId: store.getters.refereeId diff --git a/pages/login/index.vue b/pages/login/index.vue index ef63e98..1e2b648 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -20,7 +20,7 @@ </view> <view class="login-fd login-fd-on" @click="login">登录</view> <view class=""> - <mpWeiXinMobile :share_user_id="share_user_id"></mpWeiXinMobile> + <mpWeiXinMobile :refereeId="refereeId"></mpWeiXinMobile> </view> </view> </template> @@ -51,11 +51,11 @@ countdown: 60, countDownFun: null, code: '', - share_user_id: "" + refereeId: "" } }, onLoad(o) { - this.share_user_id = o.share_user_id + this.refereeId = o.refereeId }, methods: { toTextPage(n) { @@ -123,7 +123,7 @@ store.dispatch('Login', { smsCode: that.semCode, mobile: that.phoneNum, - share_user_id: this.share_user_id, + refereeId: this.refereeId, isParty: false, partyData: {}, refereeId: false diff --git a/pages/news1/jinqun.vue b/pages/news1/jinqun.vue index 3a58e1d..3703614 100644 --- a/pages/news1/jinqun.vue +++ b/pages/news1/jinqun.vue @@ -13,10 +13,11 @@ 京东电器官方福利群 </view> <view class="qcode"> - + <image :src="cityInfo.wechat"></image> </view> <view class="submitBtn"> 立即进群> + <button open-type="share"></button> </view> <view class="fuli"> <view class="fuliTitle"> @@ -45,24 +46,50 @@ export default { data() { return { - + cityInfo: {} } + }, + onReady() { + this.cityInfo = uni.getStorageSync("cityInfo") + }, + /** + * 分享当前页面 + */ + onShareAppMessage() { + return { + title: "进社群领取更多福利", + imageUrl: this.cityInfo.we + } + }, + + /** + * 分享到朋友圈 + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见分享到朋友圈 (Beta) + * https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html + */ + onShareTimeline() { + const app = this + // 构建页面参数 + const params = app.$getShareUrlParams({ + goodsId: app.goodsId, + }) + return { + title: app.goods.goods_name, + path: `/pages/goods/detail?${params}` + } } } </script> <style lang="scss" scoped> -page{ - min-height:100%; - background: url(https://www.royaum.com.cn/static/news1/jbg.png); - background-repeat: no-repeat; - background-size: cover; - width: 100%; - padding-bottom: 100upx; -} + .jinqun{ height:100%; position: relative; + background: url(https://www.royaum.com.cn/static/jinqun-bg.png); + background-repeat: no-repeat; + background-size: cover; + min-height: 100vh; .flag{ position: absolute; top:0; @@ -111,6 +138,10 @@ page{ height:400upx; margin:40upx auto; border:1px solid red; + image{ + width: 100%; + height: 100%; + } } .submitBtn{ width: 340upx; @@ -125,6 +156,16 @@ page{ line-height: 90upx; text-align: center; margin:0 auto; + position: relative; + button{ + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0; + z-index: 2; + opacity: 0; + } } .fuli{ margin: 60upx; diff --git a/pages/user/index.vue b/pages/user/index.vue index 5d876d0..b7b1638 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -582,6 +582,7 @@ distribution_order: {}, goods_order: {}, service_order: {}, + recovery_order: {}, }, actionCountsInfo: {}, userType: 2,