From feaedf83a78e8ec033db91253a0be00737a8866c Mon Sep 17 00:00:00 2001 From: fanfan Date: Sun, 3 Mar 2024 16:10:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/user.js | 4 + pages/cart/index.vue | 2 +- pages/goods/detail.vue | 26 +- pages/index/index.vue | 2605 +++++++++++++++++------------- pages/index/index1.vue | 2 +- pages/news/goods/batchdel.vue | 7 +- pages/news/goods/del.vue | 11 +- pages/news/goods/list.vue | 7 +- pages/news/rules/index.vue | 5 +- pages/news1/help.vue | 5 +- pages/news1/text.vue | 7 +- pages/news3/LogisticsDetails.vue | 8 +- pages/user/index.vue | 43 +- 13 files changed, 1556 insertions(+), 1176 deletions(-) diff --git a/api/user.js b/api/user.js index e9b5db0..9f58c51 100644 --- a/api/user.js +++ b/api/user.js @@ -62,3 +62,7 @@ export const personal = (data, option) => { export const editUser = (data, option) => { return request.post('user/editUser', data, option) } +//// 修改个人信息(头像昵称) +export const wxHeadImgUpload = (data, option) => { + return request.post('upload/wxHeadImgUpload', data, option) +} diff --git a/pages/cart/index.vue b/pages/cart/index.vue index 47dcd1c..2cad72e 100644 --- a/pages/cart/index.vue +++ b/pages/cart/index.vue @@ -81,7 +81,7 @@ {{item.goods_price_max}} 到手价 - ¥{{item.line_price_max}} + ¥{{item.line_price_min}} - + - + 店内现货 - 查看更多 - - + 查看更多 + + + @@ -119,28 +125,34 @@ - + - - 查看更多 + + 查看更多 + 本场剩余 - + - {{timeData.hours>=10?timeData.hours:"0"+Number(timeData.hours)}} + {{timeData.hours>=10?timeData.hours:"0"+Number(timeData.hours)}} : - {{timeData.minutes>=10?timeData.minutes:"0"+Number(timeData.minutes)}} + {{timeData.minutes>=10?timeData.minutes:"0"+Number(timeData.minutes)}} : - {{timeData.seconds>=10?timeData.seconds:"0"+Number(timeData.seconds)}} + {{timeData.seconds>=10?timeData.seconds:"0"+Number(timeData.seconds)}} - + @@ -157,53 +169,62 @@ - + - + - - - - 查看更多 - - - - - - - {{item.goods_price_min}} - - - - + + + + 查看更多 - - - - - 查看更多 + - + - + + {{item.goods_price_min}} + + + + + + + 查看更多 + + + + + + + {{item.goods_price_min}} + + - + + - + @@ -219,7 +240,8 @@ {{item.goods_price_max}} 到手价 - ¥{{item.line_price_max}} + ¥{{item.line_price_min}} @@ -317,14 +341,15 @@ - + - - - - {{item.name}} - + + + + {{item.name}} + @@ -350,20 +375,22 @@ --> - + 门店相册 - + - + - + @@ -375,7 +402,7 @@ @@ -385,7 +412,7 @@ {{a.contenmt}} - + @@ -411,11 +438,11 @@ --> - + - + @@ -426,12 +453,13 @@ import * as limit from '@/api/sharp/home.js'; import * as Api from '@/api/goods' import * as activity from '@/api/activity' - import * as newFunApi from '@/api/newFun' - export default{ - data(){ - return{ + import * as newFunApi from '@/api/newFun' + export default { + data() { + return { isLogin: false, isTop: false, + logoImage:'', // background: { // backgroundColor: 'transparent', // }, @@ -439,50 +467,154 @@ background: 'url(https://www.royaum.com.cn/static/index/index-bg.png) center top no-repeat', backgroundSize: '100% auto', }, - list: [ - {name: '首页'}, {name: '同城送'} - ], + list: [{ + name: '首页' + }, { + name: '同城送' + }], current: 0, - tabList:[], - tabCurrent:0, - swiperList:[`${this.$picUrl}/static/index/guanggao.png`], - gridList:[ - {image:`${this.$picUrl}/static/index/g1.png`,text:"预售专区",path:'/pages/activity/presale',type:2}, - {image:`${this.$picUrl}/static/index/g2.png`,text:"邀请有礼",path:'/pages/invite/index',type:1}, - {image:`${this.$picUrl}/static/index/g3.png`,text:"领券中心",path:'/pages/news/coupon/index',type:2}, - {image:`${this.$picUrl}/static/index/g4.png`,text:"安装报修",path:'/pages/serve/index',type: 3}, - {image:`${this.$picUrl}/static/index/g5.png`,text:"上门回收",path:'/pages/news/recycling/index',type:2}, + tabList: [], + tabCurrent: 0, + swiperList: [`${this.$picUrl}/static/index/guanggao.png`], + gridList: [{ + image: `${this.$picUrl}/static/index/g1.png`, + text: "预售专区", + path: '/pages/activity/presale', + type: 2 + }, + { + image: `${this.$picUrl}/static/index/g2.png`, + text: "邀请有礼", + path: '/pages/invite/index', + type: 1 + }, + { + image: `${this.$picUrl}/static/index/g3.png`, + text: "领券中心", + path: '/pages/news/coupon/index', + type: 2 + }, + { + image: `${this.$picUrl}/static/index/g4.png`, + text: "安装报修", + path: '/pages/serve/index', + type: 3 + }, + { + image: `${this.$picUrl}/static/index/g5.png`, + text: "上门回收", + path: '/pages/news/recycling/index', + type: 2 + }, ], - catagoryList:[], - paihangList:[], - dapaiList:[], - seckillList:[], - xinpinList:[], - goodsRecommend:[], + catagoryList: [], + paihangList: [], + dapaiList: [], + seckillList: [], + xinpinList: [], + goodsRecommend: [], isToggle: false, //第二 count: 4, value: 2, - tagsList:[ - '手机选购','电脑选购','配件选购','旧机回收' - ], - dianneiList:[ - {image:`${this.$picUrl}/static/index/goods.png`,price:"7599",linePrice:'7089',name:'iphone13 绿色 128GBiphone13 绿色 128GBiphone13 绿色 128GB',comment:'200+',rate:'99',isOwn:true,isExperss:1}, - {image:`${this.$picUrl}/static/index/goods1.png`,price:"7599",linePrice:'7089',name:'iphone13 绿色 128GB',comment:'200+',rate:'99',isOwn:true,isExperss:0}, - {image:`${this.$picUrl}/static/index/goods.png`,price:"7599",linePrice:'7089',name:'iphone13 绿色 128GB',comment:'200+',rate:'99',isOwn:true,isExperss:0}, - {image:`${this.$picUrl}/static/index/goods1.png`,price:"7599",linePrice:'7089',name:'iphone13 绿色 128GB',comment:'200+',rate:'99',isOwn:true,isExperss:1}, - {image:`${this.$picUrl}/static/index/goods.png`,price:"7599",linePrice:'7089',name:'iphone13 绿色 128GB',comment:'200+',rate:'99',isOwn:true,isExperss:0}, - {image:`${this.$picUrl}/static/index/goods1.png`,price:"7599",linePrice:'7089',name:'iphone13 绿色 128GB',comment:'200+',rate:'99',isOwn:true,isExperss:1}, - {image:`${this.$picUrl}/static/index/goods.png`,price:"7599",linePrice:'7089',name:'iphone13 绿色 128GB',comment:'200+',rate:'99',isOwn:true,isExperss:1}, - {image:`${this.$picUrl}/static/index/goods1.png`,price:"7599",linePrice:'7089',name:'iphone13 绿色 128GB',comment:'200+',rate:'99',isOwn:true,isExperss:1}, - {image:`${this.$picUrl}/static/index/goods.png`,price:"7599",linePrice:'7089',name:'iphone13 绿色 128GB',comment:'200+',rate:'99',isOwn:true,isExperss:1}, + tagsList: [ + '手机选购', '电脑选购', '配件选购', '旧机回收' ], - weixiuList:[ - ], - commentList:[ + dianneiList: [{ + image: `${this.$picUrl}/static/index/goods.png`, + price: "7599", + linePrice: '7089', + name: 'iphone13 绿色 128GBiphone13 绿色 128GBiphone13 绿色 128GB', + comment: '200+', + rate: '99', + isOwn: true, + isExperss: 1 + }, + { + image: `${this.$picUrl}/static/index/goods1.png`, + price: "7599", + linePrice: '7089', + name: 'iphone13 绿色 128GB', + comment: '200+', + rate: '99', + isOwn: true, + isExperss: 0 + }, + { + image: `${this.$picUrl}/static/index/goods.png`, + price: "7599", + linePrice: '7089', + name: 'iphone13 绿色 128GB', + comment: '200+', + rate: '99', + isOwn: true, + isExperss: 0 + }, + { + image: `${this.$picUrl}/static/index/goods1.png`, + price: "7599", + linePrice: '7089', + name: 'iphone13 绿色 128GB', + comment: '200+', + rate: '99', + isOwn: true, + isExperss: 1 + }, + { + image: `${this.$picUrl}/static/index/goods.png`, + price: "7599", + linePrice: '7089', + name: 'iphone13 绿色 128GB', + comment: '200+', + rate: '99', + isOwn: true, + isExperss: 0 + }, + { + image: `${this.$picUrl}/static/index/goods1.png`, + price: "7599", + linePrice: '7089', + name: 'iphone13 绿色 128GB', + comment: '200+', + rate: '99', + isOwn: true, + isExperss: 1 + }, + { + image: `${this.$picUrl}/static/index/goods.png`, + price: "7599", + linePrice: '7089', + name: 'iphone13 绿色 128GB', + comment: '200+', + rate: '99', + isOwn: true, + isExperss: 1 + }, + { + image: `${this.$picUrl}/static/index/goods1.png`, + price: "7599", + linePrice: '7089', + name: 'iphone13 绿色 128GB', + comment: '200+', + rate: '99', + isOwn: true, + isExperss: 1 + }, + { + image: `${this.$picUrl}/static/index/goods.png`, + price: "7599", + linePrice: '7089', + name: 'iphone13 绿色 128GB', + comment: '200+', + rate: '99', + isOwn: true, + isExperss: 1 + }, ], + weixiuList: [], + commentList: [], bannerList: [], - cityInfo:{}, + cityInfo: {}, serveList: [], couList: [], timeData: {}, @@ -490,60 +622,65 @@ curTabIndex: 0 } }, - methods:{ - onChangeSeckillCutDownTime(e){ + 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 ? '结束' : '开始' ) + url: '/pages/goods/detail?goodsId=' + sharpGoodsId + "&isSeckill=" + true + '&isBuy=' + this + .seckillCutDownTime + '&seckillText=' + (this.tabbar[this.curTabIndex].status == 10 ? + '结束' : '开始') }) }, //跳转会话列表 toChat() { - if(!uni.getStorageSync("AccessToken")){ + if (!uni.getStorageSync("AccessToken")) { uni.navigateTo({ url: "/pages/login/index" }) - return ; + return; } uni.navigateTo({ url: "/pages/news/user/message" }) }, //查看全部评论 - openPinlun(){ + openPinlun() { uni.navigateTo({ url: "/pages/news/consult/comment" }) }, //咨询 - openWx(){ + openWx() { uni.navigateTo({ url: "/pages/news/consult/index" }) }, //门店图片预览 - previewImage(i){ + previewImage(i) { uni.previewImage({ current: this.cityInfo.imageList[i], urls: this.cityInfo.imageList }) }, //跳转服务 - openServe(i){ + openServe(i) { uni.navigateTo({ - url: "/pages/activity/intimate?index="+ i + url: "/pages/activity/intimate?index=" + i }) }, - + /** * 获取nanner列表 */ async queryBannerList() { - let {status, data} = await GoodsApi.getBannerList({}); - if(status == 200){ + let { + status, + data + } = await GoodsApi.getBannerList({}); + if (status == 200) { this.bannerList = data } }, @@ -551,8 +688,12 @@ * 获取服务列表 */ async getServeList() { - const {status, message, data} = await newFunApi.serverCategoryList({}); - if(status == 200){ + const { + status, + message, + data + } = await newFunApi.serverCategoryList({}); + if (status == 200) { this.serveList = data.list } }, @@ -565,8 +706,8 @@ } = await activity.couponList(); if (status == 200) { let arr = {} - if(data.list && data.list.length > 0){ - arr = data.list.filter(a=>a.coupon_type == 10)[0] + if (data.list && data.list.length > 0) { + arr = data.list.filter(a => a.coupon_type == 10)[0] } this.couList = arr } @@ -588,23 +729,23 @@ } }) }, - goPage(url,type) { - if(type == 1){ - if(!uni.getStorageSync("AccessToken")){ + goPage(url, type) { + if (type == 1) { + if (!uni.getStorageSync("AccessToken")) { uni.navigateTo({ url: "/pages/login/index" }) - return ; + return; } - }else if(type == 2){ + } else if (type == 2) { uni.navigateTo({ url }) - }else{ + } else { uni.switchTab({ url }) - return ; + return; } uni.navigateTo({ url @@ -620,22 +761,22 @@ getRankingList(val) { // 获取首页排行榜 GoodsApi.chartsGoodsJing().then(result => { - + let arr = result.data; - let finalArr = arr.filter(item=>{ + let finalArr = arr.filter(item => { return item.category_id == val }) - if(finalArr.length>0){ + if (finalArr.length > 0) { let arr = finalArr[0].goods_list - if(arr && arr.length > 0){ - arr.map(a=>{ + if (arr && arr.length > 0) { + arr.map(a => { a.goods_price_min = Number(a.goods_price_min) a.goods_price_max = Number(a.goods_price_max) a.line_price_min = Number(a.line_price_min) a.line_price_max = Number(a.line_price_max) }) } - this.paihangList = arr + this.paihangList = arr } }) }, @@ -643,34 +784,35 @@ // 限时抢购 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())); - }else{ - this.seckillCutDownTime = 0 - } - if(result.data.goodsList && result.data.goodsList.data.length > 0){ - seckillList = result.data.goodsList.data; - for (var i = 0; i < seckillList.length; i++) { - seckillList[i].original_price = Number(seckillList[i].original_price) - seckillList[i].seckill_price_max = Number(seckillList[i].seckill_price_max) - seckillList[i].seckill_price_min = Number(seckillList[i].seckill_price_min) - if (seckillList[i].spec_type == 10) { - this.seckillList.push(seckillList[i]) - } + 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())); + } else { + this.seckillCutDownTime = 0 + } + if (result.data.goodsList && result.data.goodsList.data.length > 0) { + seckillList = result.data.goodsList.data; + for (var i = 0; i < seckillList.length; i++) { + seckillList[i].original_price = Number(seckillList[i].original_price) + seckillList[i].seckill_price_max = Number(seckillList[i].seckill_price_max) + seckillList[i].seckill_price_min = Number(seckillList[i].seckill_price_min) + if (seckillList[i].spec_type == 10) { + this.seckillList.push(seckillList[i]) } } - }) - + } + }) + }, getSuggest() { // 获取推荐商品 Api.recommended().then(res => { let arr = res.data.goodsList - if(arr && arr.length > 0){ - arr.map(a=>{ + if (arr && arr.length > 0) { + arr.map(a => { a.goods_price_min = Number(a.goods_price_min) a.goods_price_max = Number(a.goods_price_max) a.line_price_min = Number(a.line_price_min) @@ -679,13 +821,13 @@ } this.goodsRecommend = arr }) - + }, getNewGoods(val) { const that = this let param = { page: 1, - per_page:100, + per_page: 100, categoryId: val, is_brand: 0, is_new: 1, @@ -693,8 +835,8 @@ } GoodsApi.brandList(param).then(res => { let arr = res.data.data - if(arr && arr.length > 0){ - arr.map(a=>{ + if (arr && arr.length > 0) { + arr.map(a => { a.goods_price_min = Number(a.goods_price_min) a.goods_price_max = Number(a.goods_price_max) a.line_price_min = Number(a.line_price_min) @@ -714,26 +856,26 @@ const that = this let param = { page: 1, - per_page:100, + per_page: 100, categoryId: val, is_brand: 1, is_new: 0, order: 1 } GoodsApi.brandList(param).then(res => { - let arr = res.data.data; - if(arr && arr.length > 0){ - arr.map(a=>{ - a.goods_price_min = Number(a.goods_price_min) - a.goods_price_max = Number(a.goods_price_max) - a.line_price_min = Number(a.line_price_min) - a.line_price_max = Number(a.line_price_max) - }) - } - that.dapaiList = arr - - }) - .finally(() => {}) + let arr = res.data.data; + if (arr && arr.length > 0) { + arr.map(a => { + a.goods_price_min = Number(a.goods_price_min) + a.goods_price_max = Number(a.goods_price_max) + a.line_price_min = Number(a.line_price_min) + a.line_price_max = Number(a.line_price_max) + }) + } + that.dapaiList = arr + + }) + .finally(() => {}) }, goBigGoods() { uni.navigateTo({ @@ -741,7 +883,7 @@ }) }, gotoDetail(index) { - if(this.bannerList[index].redirect_url){ + if (this.bannerList[index].redirect_url) { uni.navigateTo({ url: '/pages/goods/detail?goodsId=' + this.bannerList[index].redirect_url }) @@ -779,20 +921,28 @@ url: '/pages/activity/ranking' }) }, - changeHome(val){ + changeHome(val) { this.current = val; }, - getCityInfo(){ - const that =this + getCityInfo() { + const that = this GoodsApi.cityInfo().then(res => { if (res.status == 200) { that.cityInfo = res.data; - uni.setStorageSync("cityInfo",res.data) + uni.setStorageSync("cityInfo", res.data) + } + }) + .finally(() => {}) + }, + async getStore() { + newFunApi.storeData().then(res => { + if (res.status == 200) { + this.logoImage=res.data.storeInfo.logoImage.preview_url } }) .finally(() => {}) }, - goJump(path){ + goJump(path) { uni.navigateTo({ url: path }) @@ -808,10 +958,10 @@ longitude: Number(this.cityInfo.longitude) }) }, - openScrollTo(){ + openScrollTo() { uni.pageScrollTo({ scrollTop: 0 - }) + }) }, }, onLoad() { @@ -822,1128 +972,1295 @@ this.getCoupons(); this.getServeList(); this.queryBannerList(); + this.getStore() }, onShow() { - this.isLogin = uni.getStorageSync("AccessToken")?true:false + this.isLogin = uni.getStorageSync("AccessToken") ? true : false }, onPageScroll(e) { - if (e.scrollTop <= 200 ) { // 当滚动到顶部且向下滑动时为true - this.isTop = false - } else { + if (e.scrollTop <= 200) { // 当滚动到顶部且向下滑动时为true + this.isTop = false + } else { this.isTop = true - } + } }, } \ No newline at end of file + + // .u-tab-bar ::after{ + // border:1px solid red; + // height:10px; + // width:10px; + // } + diff --git a/pages/index/index1.vue b/pages/index/index1.vue index 6a8d46e..fcfccd7 100644 --- a/pages/index/index1.vue +++ b/pages/index/index1.vue @@ -234,7 +234,7 @@ ¥ {{item.goods_price_min}} 到手价 - ¥{{item.line_price_max}} + ¥{{item.line_price_min}} diff --git a/pages/news/goods/batchdel.vue b/pages/news/goods/batchdel.vue index 93dce69..8134e50 100644 --- a/pages/news/goods/batchdel.vue +++ b/pages/news/goods/batchdel.vue @@ -10,7 +10,7 @@ - + @@ -58,6 +58,11 @@ }; }, methods: { + goDetails(item) { + uni.navigateTo({ + url: '/pages/goods/detail?goodsId=' + item.goods_id + }) + }, toPage() { uni.navigateTo({ url: "/pages/news/goods/del" diff --git a/pages/news/goods/del.vue b/pages/news/goods/del.vue index 0f5b18a..570e3a6 100644 --- a/pages/news/goods/del.vue +++ b/pages/news/goods/del.vue @@ -16,11 +16,11 @@ - + - + {{i.goods_name}} {{i.selling_point}} @@ -32,7 +32,7 @@ - + 商品状态:{{i.status==10?'上架':i.status==20?'下架':'未知'}} @@ -67,6 +67,11 @@ }; }, methods: { + goDetails(item) { + uni.navigateTo({ + url: '/pages/goods/detail?goodsId=' + item.goods_id + }) + }, selectItem(item, index) { if (this.list[index].checked) { //取消选中 if (this.checkedList.indexOf(item.goods_id) != -1) { diff --git a/pages/news/goods/list.vue b/pages/news/goods/list.vue index 8d8bc91..aafcbe1 100644 --- a/pages/news/goods/list.vue +++ b/pages/news/goods/list.vue @@ -7,7 +7,7 @@ - + @@ -56,6 +56,11 @@ } }, methods: { + goDetails(item) { + uni.navigateTo({ + url: '/pages/goods/detail?goodsId=' + item.goods_id + }) + }, getListAfter() { this.list = []; this.getList() diff --git a/pages/news/rules/index.vue b/pages/news/rules/index.vue index 10d3ffb..01f8c18 100644 --- a/pages/news/rules/index.vue +++ b/pages/news/rules/index.vue @@ -19,7 +19,7 @@ } }, onLoad(options){ - this.itemInfo = JSON.parse(options.itemInfo) + this.itemInfo = JSON.parse(decodeURIComponent(options.itemInfo)) this.title = this.itemInfo.title; this.strings = this.itemInfo.content; }, @@ -34,5 +34,8 @@ width: 100%; height: 100%; padding: 30rpx; + span{ + white-space: normal !important + } } \ No newline at end of file diff --git a/pages/news1/help.vue b/pages/news1/help.vue index 6e9a40b..bc185242 100644 --- a/pages/news1/help.vue +++ b/pages/news1/help.vue @@ -84,7 +84,7 @@ }, openContent(item) { uni.navigateTo({ - url: '/pages/news/rules/index?itemInfo=' + JSON.stringify(item) + url: '/pages/news/rules/index?itemInfo=' + encodeURIComponent(JSON.stringify(item)) }) }, } @@ -94,11 +94,10 @@ \ No newline at end of file diff --git a/pages/news3/LogisticsDetails.vue b/pages/news3/LogisticsDetails.vue index c8dd7bc..3b1b035 100644 --- a/pages/news3/LogisticsDetails.vue +++ b/pages/news3/LogisticsDetails.vue @@ -11,7 +11,7 @@ 物流单号:{{logisticsItem.express_no}}复制 + style="color: #FF6565; font-size:28rpx;margin-left: 20px;" @click="copy">复制 @@ -118,7 +118,7 @@ // background-color: #FFF; display: flex; align-items: center; - padding: 30px; + padding: 40rpx; image { width: 60px; @@ -132,9 +132,9 @@ .logis-pany { overflow: hidden; - margin-left: 15px; + margin-left: 15rpx; color: #000; - font-size: 14px; + font-size: 28rpx; text { color: #999; diff --git a/pages/user/index.vue b/pages/user/index.vue index bd9d4e5..ff40083 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -532,7 +532,7 @@ {{item.goods_price_max}} 到手价 ¥{{item.line_price_max}} + style="color: #949494;font-size: 22rpx;text-decoration: line-through;">¥{{item.line_price_min}}