Commit 3f8c3296 by wangzhihui

Merge branch 'SAAS+V4.56.0-0908' of http://192.168.3.233:8090/saas/mini-program/…

…points-mall into SAAS+V4.56.0-0908
2 parents a0bbb270 12971e11
Showing 128 changed files with 2981 additions and 1279 deletions
...@@ -55,7 +55,9 @@ ...@@ -55,7 +55,9 @@
"pages/bankAccount/list/list", "pages/bankAccount/list/list",
"pages/integral/withdrawalNote/withdrawalNote", "pages/integral/withdrawalNote/withdrawalNote",
"pages/integral/toCash/toCash", "pages/integral/toCash/toCash",
"pages/integral/withdrawalSuccess/withdrawalSuccess" "pages/integral/withdrawalSuccess/withdrawalSuccess",
"pages/SpecialSale/SpecialSale",
"pages/goodsDetail/index"
] ]
}, },
{ {
......
...@@ -5,15 +5,9 @@ ...@@ -5,15 +5,9 @@
<block wx:else> <block wx:else>
<view class="goods-action"> <view class="goods-action">
<view class="navigation-box"> <view class="navigation-box">
<view class="item" bindtap="jump" data-url="home">
<view class="sprite-icon">
<glsx-image src="mall/goods-home.png"></glsx-image>
</view>
首页
</view>
<view class="item" wx:if="{{!hideShop}}" bindtap="jump"> <view class="item" wx:if="{{!hideShop}}" bindtap="jump">
<view class="sprite-icon" > <view class="sprite-icon" >
<glsx-image src="mall/goods-shopping.png"></glsx-image> <glsx-image src="/index/goods-cart.png"></glsx-image>
</view> </view>
购物车 购物车
</view> </view>
...@@ -23,7 +17,7 @@ ...@@ -23,7 +17,7 @@
加入购物车 加入购物车
</view> </view>
<view class="btn pay text-center {{payDisabled && hideShop?'disabled':''}} {{stock?'disabled':''}} {{buyFlag?'disabled':''}}" bindtap="click" data-event="pay"> <view class="btn pay text-center {{payDisabled && hideShop?'disabled':''}} {{stock?'disabled':''}} {{buyFlag?'disabled':''}}" bindtap="click" data-event="pay">
立即购买 立即兑换
</view> </view>
</view> </view>
</view> </view>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
} }
} }
.goods-action { .goods-action {
padding: 10rpx var(--margin); padding: 12rpx 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
...@@ -57,23 +57,24 @@ ...@@ -57,23 +57,24 @@
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: auto; margin-left: auto;
border-radius: var(--borderRadius); border-radius: 20rpx;
overflow: hidden; overflow: hidden;
} }
.btn-box .btn { .btn-box .btn {
width: 258rpx; width: 304rpx;
height: 80rpx; height: 84rpx;
color: #fff; color: #fff;
font-size: 28rpx; font-size: 28rpx;
} }
.btn-box .pay { .btn-box .pay {
background-color: var(--btnColor); background-color: #FB8A32;
} }
.btn-box .join { .btn-box .join {
background-color: #FDC23E; color: #FB8A32;
background-color: #FEF2EA;
} }
.btn-box.true .join{ .btn-box.true .join{
display: none; display: none;
......
...@@ -9,40 +9,7 @@ Component({ ...@@ -9,40 +9,7 @@ Component({
properties: { properties: {
list: { list: {
type: Array, type: Array,
value: [], value: []
observer(val, o) {
if (val) {
val.forEach(v => {
v.IMGURL = this.data.IMGURL
let n = v.goods
if (n) {
if (n.activityInfo) {
n.originalPrice = ''
n.retailPrice = n.activityInfo.activityPrice
n.goodsStatistics.saleAmount = n.activityInfo.saleAmount
if (n.activityInfo.specificationExtraList && n.activityInfo.specificationExtraList.length) {
n.retailPrice = n.activityInfo.specificationExtraList[0].retailPrice
v.up = true
}
} else {
if (n.originalPrice) n.originalPrice = centsToyuan(n.originalPrice)
if (n.specificationDetailList && n.specificationDetailList.length) {
n.retailPrice = n.specificationDetailList[0].retailPrice
v.up = true
}
}
n.retailPrice = Number(centsToyuan(n.retailPrice)).toFixed(2)
if (n.retailPrice > 9999) {
n.retailPrice = Number(n.retailPrice / 10000).toFixed(2)
v.unit = '万'
}
}
})
this.setData({
list: val
})
}
}
} }
}, },
...@@ -68,27 +35,15 @@ Component({ ...@@ -68,27 +35,15 @@ Component({
this this
) )
}, },
jump(e) { // 进入商品详情
let { handleSale(e) {
item let { target } = e.currentTarget.dataset
} = e.currentTarget.dataset wx.p.router.go('/packageIndex/pages/goodsDetail/index', target)
let { },
id, // 加入购物车
activityInfo joinCart(e) {
} = item.classifyName && item.classifyName == '秒杀' ? item : item.goods let { target } = e.currentTarget.dataset
let isActivity = false console.log('33333')
if (activityInfo) {
id = activityInfo.id
isActivity = true
}
if (item.classifyName && item.classifyName == '秒杀') {
isActivity = true
}
wx.p.router.go('/packageMall/pages/detail/detail', {
id,
isActivity,
notIntercept: true
})
} }
}, },
lifetimes: { lifetimes: {
......
...@@ -17,45 +17,28 @@ ...@@ -17,45 +17,28 @@
</block> </block>
</view> </view>
<template name="item"> <template name="item">
<view class='item-box' wx:if="{{item.goods}}" bindtap='jump' data-item="{{item}}"> <view class='item-box' wx:if="{{item.goodsId}}" bindtap='handleSale' data-target="{{item}}">
<view class="preview"> <view class="preview">
<image webp src="{{item.goods.goodsImage}}" lazy-load></image> <image webp src="{{item.goodsUrl}}" lazy-load></image>
</view> </view>
<view class="item-box-content"> <view class="item-box-content">
<view class='item-box-title'> <view class='item-box-title'>
<image class="item-box-title-image" wx:if="{{item.goods.isMemberGoods}}" webp src="{{item.IMGURL}}index/member-goods-icon.png" /> <text class="item-box-title-text">{{item.goodsName}}</text>
<text class="item-box-title-text">{{item.goods.goodsName}}</text>
</view>
<view class='item-box-time'>
<view class="text text-hide">
{{item.goodsStatistics.viewAmount||0}}人查看|售出{{item.goodsStatistics.saleAmount || 0}}
</view>
</view> </view>
<view class="item-box-price"> <view class="item-box-price">
<view class="now"> <view class="points-price">
<text class="unit">¥</text> {{item.salePoints}}
<text>{{fn.priceFilter(item.goods.retailPrice || 0, 0)}}.</text> <text>积分</text>
<text class="price-last">{{fn.priceFilter(item.goods.retailPrice || 0, 1)}}</text>
<text class="unit up" wx:if="{{item.unit}}">{{item.unit}}</text>
<text class="unit up" wx:if="{{item.up}}">起</text>
</view>
<block wx:if="{{item.goods.originalPrice >= 0 && item.goods.originalPrice}}">
<view class="old">¥{{item.goods.originalPrice || 0}}</view>
</block>
</view> </view>
<view class="item-box-bubble">
<!-- 会员商品 -->
<view wx:if="{{item.goods.isMemberGoods}}" class="text item-box-bubble-view">
<text class="item-box-bubble-text">会员价</text>
开通会员权益立享
</view> </view>
<view class="item-box-btn">
<view class="market-price">市场价: <text>¥{{item.marketPrice}}</text></view>
<view class="btn" catchtap="handleSale" data-target="{{item}}">
<view class="cart" catchtap="joinCart" data-target="{{item}}">
<glsx-image src="/index/cart.png"></glsx-image>
</view> </view>
<view class="item-box-goods-label"> <view>兑换</view>
<view wx:if="{{item.goods.relatedCoupon}}" class="coupon-logotype">
<text wx:if="{{item.goods.relatedCoupon}}" class="coupon-logo">券</text>
<text class="coupon-name">{{item.goods.relatedCoupon.couponName}}</text>
</view> </view>
<view wx:if="{{item.goods.freeShipping}}" class="free-shipping">包邮</view>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
flex-wrap: wrap; flex-wrap: wrap;
padding: 16rpx 20rpx 0; padding: 16rpx 20rpx 0;
box-sizing: border-box; box-sizing: border-box;
border-radius: 24rpx 24rpx 0 0;
} }
.Goods .left, .Goods .right { .Goods .left, .Goods .right {
display: inline-block; display: inline-block;
...@@ -24,7 +26,6 @@ ...@@ -24,7 +26,6 @@
.left .item-box, .right .item-box{ .left .item-box, .right .item-box{
margin-bottom: 20rpx; margin-bottom: 20rpx;
background: #FFFFFF;
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
} }
...@@ -40,6 +41,8 @@ ...@@ -40,6 +41,8 @@
.item-box .preview{ .item-box .preview{
width: 100%; width: 100%;
height: 344rpx; height: 344rpx;
border-radius: 24rpx;
overflow: hidden;
} }
.item-box-content{ .item-box-content{
...@@ -83,103 +86,44 @@ ...@@ -83,103 +86,44 @@
align-items: center; align-items: center;
} }
.item-box-price{ .item-box-price{
margin-top: 12rpx; color: #FC5B32;
display: flex; font-size: 38rpx;
align-items: center; font-weight: 500;
margin-top: 14rpx;
font-size: 20rpx;
}
.item-box-price .now{
font-size: 40rpx;
color: var(--btnColor);
font-weight: 600;
}
.item-box-price .now .unit{
font-size: 24rpx;
} }
.item-box-price .now .price-last{ .item-box-price text{
font-size: 24rpx; font-weight: 400;
font-size: 22rpx;
} }
.item-box-price .old{ .item-box-btn {
color: #3F444D; display: flex;
text-decoration: line-through; justify-content: space-between;
margin-left: 8rpx; margin-top: 10rpx;
margin-bottom: -10rpx;
} }
.item-box-btn .market-price {
.item-box-bubble .item-box-bubble-view{
position: relative;
background: #FFF5F3;
height: 40rpx;
line-height: 40rpx;
padding-left: 12rpx;
border-radius: 0 8rpx 8rpx 8rpx;
margin-top: 14rpx;
font-size: 20rpx; font-size: 20rpx;
color: #FF6038; color: #858A94;
}
.item-box-bubble .item-box-bubble-view::after {
content: '';
position: absolute;
width: 0;
height: 0;
top: -16rpx;
right: -16rpx;
left: 0;
border-right: 16rpx solid transparent;
border-bottom: 16rpx solid #FFF5F3;
} }
.item-box-btn .market-price text {
.item-box-bubble .item-box-bubble-text{ text-decoration: line-through;
margin-right: 16rpx;
} }
.item-box-btn .btn {
.item-box-goods-label{ box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 8rpx; justify-content: space-between;
position: relative; padding-right: 16rpx;
} color: #FFFFFF;
font-weight: 500;
.coupon-logotype, .free-shipping{ font-size: 24rpx;
font-size: 16rpx; width: 132rpx;
height: 22rpx; height: 48rpx;
border: 2rpx solid #FF6038; background: #FB8A32;
border-radius: 4rpx; border-radius: 14rpx;
color: #FF590E;
}
.coupon-logotype{
position: relative;
}
.coupon-logotype .coupon-logo{
color: #fff;
width: 26rpx;
height: 26rpx;
position: absolute;
left: -2rpx;
top: -2rpx;
margin: 0;
display: inline-block;
text-align: center;
border-radius: 4rpx;
font-size: 16rpx;
line-height: 24rpx;
background: #FF6038;
}
.coupon-logotype .coupon-name{
margin-left: 30rpx;
padding-right: 4rpx;
} }
.free-shipping{ .item-box-btn .btn .cart {
margin-left: 8rpx; width: 48rpx;
padding: 0 8rpx; height: 48rpx;
} }
"use strict";function e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}/*!
* mp-html v2.2.2
* https://github.com/jin-yufeng/mp-html
*
* Released under the MIT license
* Author: Jin Yufeng
*/
var t=require("./parser"),n=[];Component({data:{nodes:[]},properties:{containerStyle:String,content:{type:String,value:"",observer:function(e){this.setContent(e)}},copyLink:{type:Boolean,value:!0},domain:String,errorImg:String,lazyLoad:Boolean,loadingImg:String,pauseVideo:{type:Boolean,value:!0},previewImg:{type:Boolean,value:!0},scrollTable:Boolean,selectable:null,setTitle:{type:Boolean,value:!0},showImgMenu:{type:Boolean,value:!0},tagStyle:Object,useAnchor:null},created:function(){this.plugins=[];for(var e=n.length;e--;)this.plugins.push(new n[e](this))},detached:function(){clearInterval(this._timer),this._hook("onDetached")},methods:{in:function(e,t,n){e&&t&&n&&(this._in={page:e,selector:t,scrollTop:n})},navigateTo:function(t,n){var o=this;return new Promise(function(i,r){if(!o.data.useAnchor)return void r(Error("Anchor is disabled"));var a=wx.createSelectorQuery().in(o._in?o._in.page:o).select((o._in?o._in.selector:"._root")+(t?"".concat(">>>","#").concat(t):"")).boundingClientRect();o._in?a.select(o._in.selector).scrollOffset().select(o._in.selector).boundingClientRect():a.selectViewport().scrollOffset(),a.exec(function(t){if(!t[0])return void r(Error("Label not found"));var a=t[1].scrollTop+t[0].top-(t[2]?t[2].top:0)+(n||parseInt(o.data.useAnchor)||0);o._in?o._in.page.setData(e({},o._in.scrollTop,a)):wx.pageScrollTo({scrollTop:a,duration:300}),i()})})},getText:function(e){var t="";return function e(n){for(var o=0;o<n.length;o++){var i=n[o];if("text"===i.type)t+=i.text.replace(/&amp;/g,"&");else if("br"===i.name)t+="\n";else{var r="p"===i.name||"div"===i.name||"tr"===i.name||"li"===i.name||"h"===i.name[0]&&i.name[1]>"0"&&i.name[1]<"7";r&&t&&"\n"!==t[t.length-1]&&(t+="\n"),i.children&&e(i.children),r&&"\n"!==t[t.length-1]?t+="\n":"td"!==i.name&&"th"!==i.name||(t+="\t")}}}(e||this.data.nodes),t},getRect:function(){var e=this;return new Promise(function(t,n){wx.createSelectorQuery().in(e).select("._root").boundingClientRect().exec(function(e){return e[0]?t(e[0]):n(Error("Root label not found"))})})},pauseMedia:function(){for(var e=(this._videos||[]).length;e--;)this._videos[e].pause()},setContent:function(e,n){var o=this;this.imgList&&n||(this.imgList=[]),this._videos=[];var i={},r=new t(this).parse(e);if(n)for(var a=this.data.nodes.length,l=r.length;l--;)i["nodes[".concat(a+l,"]")]=r[l];else i.nodes=r;this.setData(i,function(){o._hook("onLoad"),o.triggerEvent("load")});var s;clearInterval(this._timer),this._timer=setInterval(function(){o.getRect().then(function(e){e.height===s&&(o.triggerEvent("ready",e),clearInterval(o._timer)),s=e.height}).catch(function(){})},350)},_hook:function(e){for(var t=n.length;t--;)this.plugins[t][e]&&this.plugins[t][e]()},_add:function(e){e.detail.root=this}}});
\ No newline at end of file \ No newline at end of file
{"component":true,"usingComponents":{"node":"./node/node"}}
\ No newline at end of file \ No newline at end of file
<view class="_root {{selectable?'_select':''}}" style="{{containerStyle}}"><slot wx:if="{{!nodes[0]}}"/><node id="_root" childs="{{nodes}}" opts="{{[lazyLoad,loadingImg,errorImg]}}" catchadd="_add"/></view>
\ No newline at end of file \ No newline at end of file
._root{padding:1px 0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}._select{-webkit-user-select:text;user-select:text}
\ No newline at end of file \ No newline at end of file
"use strict";function t(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}Component({data:{ctrl:{}},properties:{childs:Array,opts:Array},attached:function(){this.triggerEvent("add",this,{bubbles:!0,composed:!0})},methods:{noop:function(){},getNode:function(t){for(var i=t.split("_"),e=this.data.childs[i[0]],r=1;r<i.length;r++)e=e.children[i[r]];return e},play:function(t){if(this.root.data.pauseVideo){for(var i=!1,e=t.target.id,r=this.root._videos.length;r--;)this.root._videos[r].id===e?i=!0:this.root._videos[r].pause();if(!i){var s=wx.createVideoContext(e,this);s.id=e,this.root._videos.push(s)}}},imgTap:function(t){var i=this.getNode(t.target.dataset.i);if(i.a)return this.linkTap(i.a);if(!i.attrs.ignore&&(this.root.triggerEvent("imgtap",i.attrs),this.root.data.previewImg)){var e=this.root.imgList[i.i];wx.previewImage({current:e,urls:this.root.imgList})}},imgLoad:function(i){var e,r=i.target.dataset.i,s=this.getNode(r);s.w?(this.data.opts[1]&&!this.data.ctrl[r]||-1===this.data.ctrl[r])&&(e=1):e=i.detail.width,e&&this.setData(t({},"ctrl."+r,e))},linkTap:function(t){var i=t.currentTarget?this.getNode(t.currentTarget.dataset.i):{},e=i.attrs||t,r=e.href;this.root.triggerEvent("linktap",Object.assign({innerText:this.root.getText(i.children||[])},e)),r&&("#"===r[0]?this.root.navigateTo(r.substring(1)).catch(function(){}):r.split("?")[0].includes("://")?this.root.data.copyLink&&wx.setClipboardData({data:r,success:function(){return wx.showToast({title:"链接已复制"})}}):wx.navigateTo({url:r,fail:function(){wx.switchTab({url:r,fail:function(){}})}}))},mediaError:function(i){var e=i.target.dataset.i,r=this.getNode(e);if("video"===r.name||"audio"===r.name){var s=(this.data.ctrl[e]||0)+1;if(s>r.src.length&&(s=0),s<r.src.length)return this.setData(t({},"ctrl."+e,s))}else"img"===r.name&&this.data.opts[2]&&this.setData(t({},"ctrl."+e,-1));this.root&&this.root.triggerEvent("error",{source:r.name,attrs:r.attrs,errMsg:i.detail.errMsg})}}});
\ No newline at end of file \ No newline at end of file
{"component":true,"usingComponents":{"node":"./node"}}
\ No newline at end of file \ No newline at end of file
<wxs module="use">var e={abbr:!0,b:!0,big:!0,code:!0,del:!0,em:!0,i:!0,ins:!0,label:!0,q:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0};module.exports=function(n){return!n.c&&(!n.children||"a"===n.name||!e[n.name]&&-1===(n.attrs.style||"").indexOf("inline"))};</wxs><template name="el"><block wx:if="{{n.name==='img'}}"><image wx:if="{{(opts[1]&&!ctrl[i])||ctrl[i]<0}}" class="_img" style="{{n.attrs.style}}" src="{{ctrl[i]<0?opts[2]:opts[1]}}" mode="widthFix"/><image id="{{n.attrs.id}}" class="_img {{n.attrs.class}}" style="{{ctrl[i]===-1?'display:none;':''}}width:{{ctrl[i]||1}}px;height:1px;{{n.attrs.style}}" src="{{n.attrs.src}}" mode="{{n.h?'':'widthFix'}}" lazy-load="{{opts[0]}}" webp="{{n.webp}}" show-menu-by-longpress="{{opts[3]&&!n.attrs.ignore}}" data-i="{{i}}" bindload="imgLoad" binderror="mediaError" catchtap="{{opts[4] ? 'imgTap' : ''}}" bindlongpress="noop"/></block><text wx:elif="{{n.text}}" user-select="{{n.us}}" decode>{{n.text}}</text><text wx:elif="{{n.name==='br'}}">\n</text><view wx:elif="{{n.name==='a'}}" id="{{n.attrs.id}}" class="{{n.attrs.href?'_a ':''}}{{n.attrs.class}}" hover-class="_hover" style="display:inline;{{n.attrs.style}}" data-i="{{i}}" catchtap="linkTap"><node childs="{{n.children}}" opts="{{opts}}" style="display:inherit"/></view><video wx:elif="{{n.name==='video'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" autoplay="{{n.attrs.autoplay}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" muted="{{n.attrs.muted}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError"/><audio wx:elif="{{n.name==='audio'}}" id="{{n.attrs.id}}" class="{{n.attrs.class}}" style="{{n.attrs.style}}" author="{{n.attrs.author}}" controls="{{n.attrs.controls}}" loop="{{n.attrs.loop}}" name="{{n.attrs.name}}" poster="{{n.attrs.poster}}" src="{{n.src[ctrl[i]||0]}}" data-i="{{i}}" bindplay="play" binderror="mediaError"/><rich-text wx:else id="{{n.attrs.id}}" style="{{n.f}}" nodes="{{[n]}}"/></template><block wx:for="{{childs}}" wx:for-item="n1" wx:for-index="i1" wx:key="i1"><template wx:if="{{use(n1)}}" is="el" data="{{n:n1,i:''+i1,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n1.attrs.id}}" class="_{{n1.name}} {{n1.attrs.class}}" style="{{n1.attrs.style}}"><block wx:for="{{n1.children}}" wx:for-item="n2" wx:for-index="i2" wx:key="i2"><template wx:if="{{use(n2)}}" is="el" data="{{n:n2,i:i1+'_'+i2,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n2.attrs.id}}" class="_{{n2.name}} {{n2.attrs.class}}" style="{{n2.attrs.style}}"><block wx:for="{{n2.children}}" wx:for-item="n3" wx:for-index="i3" wx:key="i3"><template wx:if="{{use(n3)}}" is="el" data="{{n:n3,i:i1+'_'+i2+'_'+i3,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n3.attrs.id}}" class="_{{n3.name}} {{n3.attrs.class}}" style="{{n3.attrs.style}}"><block wx:for="{{n3.children}}" wx:for-item="n4" wx:for-index="i4" wx:key="i4"><template wx:if="{{use(n4)}}" is="el" data="{{n:n4,i:i1+'_'+i2+'_'+i3+'_'+i4,opts:opts,ctrl:ctrl}}"/><view wx:else id="{{n4.attrs.id}}" class="_{{n4.name}} {{n4.attrs.class}}" style="{{n4.attrs.style}}"><block wx:for="{{n4.children}}" wx:for-item="n5" wx:for-index="i5" wx:key="i5"><template wx:if="{{use(n5)}}" is="el" data="{{n:n5,i:i1+'_'+i2+'_'+i3+'_'+i4+'_'+i5,opts:opts,ctrl:ctrl}}"/><node wx:else id="{{n5.attrs.id}}" class="_{{n5.name}} {{n5.attrs.class}}" style="{{n5.attrs.style}}" childs="{{n5.children}}" opts="{{opts}}"/></block></view></block></view></block></view></block></view></block>
\ No newline at end of file \ No newline at end of file
._a{padding:1.5px 0 1.5px 0;color:#366092;word-break:break-all}._hover{text-decoration:underline;opacity:.7}._img{max-width:100%;-webkit-touch-callout:none}._b,._strong{font-weight:700}._code{font-family:monospace}._del{text-decoration:line-through}._em,._i{font-style:italic}._h1{font-size:2em}._h2{font-size:1.5em}._h3{font-size:1.17em}._h5{font-size:.83em}._h6{font-size:.67em}._h1,._h2,._h3,._h4,._h5,._h6{display:block;font-weight:700}._ins{text-decoration:underline}._li{display:list-item}._ol{list-style-type:decimal}._ol,._ul{display:block;padding-left:40px;margin:1em 0}._q::before{content:'"'}._q::after{content:'"'}._sub{font-size:smaller;vertical-align:sub}._sup{font-size:smaller;vertical-align:super}._tbody,._tfoot,._thead{display:table-row-group}._tr{display:table-row}._td,._th{display:table-cell;vertical-align:middle}._th{font-weight:700;text-align:center}._ul{list-style-type:disc}._ul ._ul{margin:0;list-style-type:circle}._ul ._ul ._ul{list-style-type:square}._abbr,._b,._code,._del,._em,._i,._ins,._label,._q,._span,._strong,._sub,._sup{display:inline}._blockquote,._div,._p{display:block}
\ No newline at end of file \ No newline at end of file
...@@ -209,3 +209,65 @@ export const AddressInfo = [ ...@@ -209,3 +209,65 @@ export const AddressInfo = [
key: "phone", key: "phone",
}, },
]; ];
export const OrderStatus = [
{
title: "待付款",
value: "1",
image: "mine/order-wait.png",
tips:'待付款'
},
{
title: "已支付",
value: "2",
image: "mine/order-receiving.png",
tips:'已支付'
},
{
title: "已关闭",
value: "3",
image: "mine/order-close.png",
tips:'已关闭'
},
{
title: "已发货",
value: "4",
image: "mine/order-receiving.png",
tips:'已发货'
},
{
title: "已收货",
value: "5",
image: "mine/order-success.png",
tips:'已收货'
},
{
title: "待发货",
value: "6",
image: "mine/order-wait.png",
tips:'待发货'
},
{
title: "待安装",
value: "7",
image: "mine/order-wait.png",
tips:'待安装'
},
{
title: "已安装",
value: "8",
image: "mine/order-success.png",
tips:'已安装'
},
{
title: "售后中",
value: "9",
image: "mine/order-wait.png",
tips:'售后中'
},
{
title: "售后完成",
value: "10",
image: "mine/order-close.png",
tips:'售后完成'
},
];
// packageIndex/pages/SpecialSale/SpecialSale.js
Page({
/**
* 页面的初始数据
*/
data: {
pageParams: {},
goodsList: [{
goodsId: '1',
goodsUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.png',
goodsName: 'Tempo得宝手帕纸',
salePoints: '10',
marketPrice: '15.9'
}, {
goodsId: '2',
goodsUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.png',
goodsName: '维达抽纸超韧整箱M码家用实惠装面巾纸',
salePoints: '69.9',
marketPrice: '79.9'
}, {
goodsId: '3',
goodsUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.png',
goodsName: '5100西藏冰川矿泉水整箱',
salePoints: '10',
marketPrice: '15.9'
}, {
goodsId: '4',
goodsUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/login/login-img.png',
goodsName: '洁柔Face纸巾抽纸3层',
salePoints: '10',
marketPrice: '15.9'
}]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.p.router.getRouterParams(options).then(params => {
console.log(params)
this.setData({
pageParams: params
})
}).catch(err => {
console.error('参数获取失败:', err)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": { "usingComponents": {
"goods": "/components/goods/goods"
}, },
"component": true "navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
/* packageIndex/pages/SpecialSale/SpecialSale.wxss */
.page-title {
text-align: center;
color: #2D2D2E;
font-size: 34rpx;
font-weight: 600;
}
.container {
overflow: auto;
.special-image {
width: 100%;
height: 360rpx;
}
.goods-content {
width: 100%;
box-sizing: border-box;
margin-top: -66rpx;
background-image: linear-gradient(180deg, #ffffffb3 0%, #FFFFFF 9%);
border-radius: 24rpx 24rpx 0 0;
padding: 20rpx 0;
border: 2rpx solid #FFFFFF;
border-bottom: 0;
backdrop-filter: blur(20rpx);
}
}
\ No newline at end of file \ No newline at end of file
<!--packageIndex/pages/SpecialSale/SpecialSale.wxml-->
<navigation-bar page-title="专场" navStyle="{{navStyle}}" showBack="{{true}}">
<view class="page-title">{{pageParams.saleName}}</view>
</navigation-bar>
<block wx:if="{{navHeight}}">
<view class="container" style="height: calc(100vh - {{navHeight}}px);margin-top: {{navHeight}}px;">
<view class="special-image">
<glsx-image src="{{pageParams.url}}"></glsx-image>
</view>
<view class="goods-content">
<view class="goods-content-top"></view>
<view class="goods-box">
<goods list="{{goodsList}}"></goods>
</view>
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
import { shopmallApi } from '~/api/api'
Component({
/**
* 组件的属性列表
*/
properties: {
idIndex: Number,
address:Array,
show: {
type: Boolean,
observer: function (val, o) {
if (val && this.properties.address.length) {
this.properties.address.forEach((item, index) => {
if (item.id == this.properties.idIndex) {
this.setData({
currentIndex: index,
})
}
})
}
}
},
staff:Boolean
},
/**
* 组件的初始数据
*/
data: {
currentIndex: 0,
addressList: []
},
/**
* 组件的方法列表
*/
methods: {
back() {
// this.triggerEvent('getAddress', { addressInfo: this.data.addressInfo })
this.cancel()
},
comfirm(e) {
let { url } = e.currentTarget.dataset
wx.$router.go(url,{
platform:true,
staff:this.data.staff,
notIntercept:this.data.staff
})
// this.cancel()
},
cancel() {
this.setData({
show: false
})
},
toSelect(e) {
const { item } = e.currentTarget.dataset
const contactAddress = item.provinceName+item.cityName+item.countyName+item.address
this.triggerEvent('getAddress', {defaultAddress:item,contactAddress})
this.cancel()
},
addressList() {
let para = {}
console.log(this.data.staff,'this.data.staff');
if(this.data.staff){
para.businessType = 1
}
shopmallApi.platformAddressList(para).then(data => {
this.setData({
address: data
})
wx.hideLoading()
})
}
},
lifetimes: {
attached: function () {
wx.$eventbus.on('REFRESH_PLATFORM_ADDRESS',()=>{
this.addressList()
})
},
},
})
.popclass {
border-radius: 16rpx 16rpx 0 0;
}
.container {
height: 100%;
}
.address-container {
position: fixed;
left: 0;
bottom: 0;
right: 0;
top: 0;
z-index: 9;
.address-bg {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .6);
}
.container {
position: absolute;
width: 100%;
height: 80%;
box-sizing: border-box;
background: #FFFFFF;
border-radius: 20rpx 20rpx 0 0;
left: 0;
bottom: 0;
animation: show-sku-box .5s forwards;
z-index: 2;
padding: 44rpx 40rpx;
}
}
.headeer {
height: 104rpx;
background: #F7F7F7;
border-radius: 16rpx 16rpx 0 0;
box-sizing: border-box;
padding: 0 40rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
.title {
font-weight: 500;
font-size: 32rpx;
color: #282829;
}
}
.list-pannel {
height: 868rpx;
.scroll {
height: 868rpx;
}
.cell {
display: flex;
align-items: center;
box-sizing: border-box;
padding: 32rpx 40rpx;
position: relative;
.check-box {
margin-right: 20rpx;
.icon {
width: 40rpx;
height: 40rpx;
}
}
.content-box {
.name-phone {
font-weight: 400;
font-size: 24rpx;
color: #707071;
}
.address {
width: 606rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 28rpx;
color: #333435;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
line-height: 44rpx;
margin: 4rpx 0 10rpx 0;
}
.default-tip {
width: 104rpx;
height: 32rpx;
background: #f13c3d0f;
border: 1.2rpx solid #F13C3D;
border-radius: 4rpx;
font-weight: 400;
font-size: 20rpx;
color: #F13C3D;
}
}
.line {
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 670rpx;
height: 2rpx;
background: #EFF0F2;
}
}
}
.footer {
height: 104rpx;
background: #FFFFFF;
box-shadow: 0 0 0 0 #E9E9E9;
box-sizing: border-box;
padding: 0 32rpx;
.btn {
width: 100%;
height: 80rpx;
background: #ffffff0f;
border: 2rpx solid #FC5B32;
border-radius: 8rpx;
font-weight: 500;
font-size: 28rpx;
color: #EE7A31;
}
}
.flex_sbc {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
\ No newline at end of file \ No newline at end of file
<!-- <van-popup show="{{ show }}" bind:click-overlay="cancel" custom-class="popclass" position="bottom" custom-style="height: 1076rpx"></van-popup> -->
<view class="address-container" hidden="{{!show}}">
<view class="address-bg" bindtap="cancel"></view>
<view class="container">
<view class="headeer flex_sbc">
<!-- <glsx-image bind:tap="back" webp class="icon" src="glsx/equity/version/3_9_0/back-icon.png"></glsx-image> -->
<view></view>
<view class="title">选择收货地址</view>
<glsx-image bind:tap="cancel" webp class="icon" src="glsx/equity/version/3_9_0/close-icon.png"></glsx-image>
</view>
<view class="list-pannel">
<scroll-view class="scroll" scroll-y="{{true}}">
<block wx:for="{{address}}" wx:key="index">
<view bind:tap="toSelect" data-item="{{item}}" data-index="{{index}}" class="cell">
<view class="check-box">
<glsx-image webp class="icon" src="glsx/equity/version/3_9_0/{{currentIndex==index?'select-icon-active':'select-icon'}}.png"></glsx-image>
</view>
<view class="content-box">
<view class="name-phone">{{item.receiveName}} {{item.receiveMobile}}</view>
<view class="address">{{item.provinceName}}{{item.cityName}}{{item.countyName}}{{item.address}}</view>
<view wx:if="{{item.isDefault==1}}" class="default-tip flex_cc">默认地址</view>
</view>
<view class="line"></view>
</view>
</block>
</scroll-view>
</view>
<view class="footer flex_cc">
<view bind:tap="comfirm" data-url="/packageShopmall/packageMine/pages/address/detail/detail" class="btn flex_cc">新增地址</view>
</view>
</view>
</view>
// import { shopmallApi } from '~/api/api'
// import USERAPI from "~/api/usersApi/index";
import NP from 'number-precision'
Component({
/**
* 组件的属性列表
*/
properties: {
show: Boolean,
address: Array,
type: String,
goods: Object,
defaultAddress: Object,
defaultAds: String,
staffShop:Boolean,
canPay:Boolean
},
data: {
currentIndex: 0,
goodsNumber: 1,
showJfModal:false,
jfCount:0
},
/**
* 组件的方法列表
*/
methods: {
computeJf(num) {
let {goods,jfCount,staffShop} = this.data
if(!staffShop)return
jfCount = NP.times(goods.redeemPoints,num)
this.setData({
jfCount
})
},
cancel() {
this.setData({
show: false
})
this.triggerEvent('cancelSku')
},
changeCount(e) {
this.triggerEvent('getCount', e.detail)
this.computeJf(e.detail)
this.setData({
goodsNumber: e.detail
})
},
toShowAddressModal() {
console.log('222')
this.setData({
showAddress: true
})
},
getAddress(e) {
this.setData({
defaultAds: e.detail.contactAddress,
defaultAddress: e.detail.defaultAddress
})
this.triggerEvent('sameAddress', e.detail)
},
intRemain(e) {
this.setData({
remain: e.detail.value
})
},
toCreatedOrder() {
const userInfo = wx.$util.getUserInfo()
const userStorage = wx.$storage.get("userInfo");
const { remain, goods, goodsNumber, defaultAddress,staffShop } = this.data
if(!defaultAddress.receiveName){
return wx.$api.showToast('请选择收货地址')
}
const params = {
receiveName: defaultAddress.receiveName,
receiveMobile: defaultAddress.receiveMobile,
provinceId: defaultAddress.provinceId,
provinceName: defaultAddress.provinceName,
cityId: defaultAddress.cityId,
cityName: defaultAddress.cityName,
countyId: defaultAddress.countyId,
countyName: defaultAddress.countyName,
address: defaultAddress.address,
customerOpenId:staffShop?userStorage.weChatOpenId:userInfo.openId,
buyerMsg: remain,
orderGoodsList: [{
goodsSkuCode: goods.goodsSkuCode,
goodsSkuName: goods.goodsSkuName,
sellQty: goodsNumber,
}],
}
wx.$api.showLoading('支付中...')
const HTTPNAME = staffShop?'jfToCreateOrder':'platformGoodsCreateOrder'
shopmallApi[HTTPNAME](params).then(res => {
if(staffShop&&!goods.salePrice){
wx.hideLoading();
wx.$router.reLaunch('/packageStoreAssistant/packageMine/pages/ShopPaySuccess/index')
return
}
if (res) this.toPayOrder(res.orderCode)
})
},
toPayOrder(orderCode) {
const { staffShop } = this.data
const HTTPNAME =staffShop?'orderCreatePay':'platformGoodsPayOrder'
shopmallApi[HTTPNAME]({ orderCode, paymentSource: 1 }).then(res => {
wx.hideLoading();
if (res) {
const { timeStamp, nonceStr, packages, signType, paySign } = res.payParams
wx.requestPayment({
timeStamp: timeStamp,
nonceStr: nonceStr,
package: packages,
signType: signType,
paySign: paySign,
success() {
const URL = staffShop?'/packageStoreAssistant/packageMine/pages/ShopPaySuccess/index':'/packageShopmall/packageMine/pages/order/complete/complete'
wx.$router.reLaunch(URL, {
success: true,
})
},
fail(res) {
if (res.errMsg == 'requestPayment:fail cancel') {
wx.$api.showToast('取消支付')
}
}
})
}
if(staffShop){
wx.$eventbus.emit('REFRESH_WITHDRALWAL')
}
})
},
// 检查登录状态
async checkLoginStatus() {
if(this.data.staffShop){
this.setData({showJfModal:true})
return
}
const sessionId = wx.$util.getSessionId(),
userInfo = wx.$util.getUserInfo() || null;
if ((userInfo && !userInfo.phone) || !userInfo) return this.reLogin()
if (sessionId) {
const {
code
} = await USERAPI.checkSession({
sessionId,
});
if (code == "0") this.toCreatedOrder()
else this.reLogin();
} else this.reLogin();
},
reLogin() {
wx.navigateTo({
url: '/pages/Login/Login'
})
}
}
})
{
"component": true,
"usingComponents": {
"address":"../Adress/index",
"stepper": "/components/Stepper/Stepper"
}
}
\ No newline at end of file \ No newline at end of file
.sku-container {
position: fixed;
left: 0;
bottom: 0;
right: 0;
top: 0;
z-index: 9;
.sku-bg {
position: absolute;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .6);
}
.container {
position: absolute;
width: 100%;
height: 80%;
box-sizing: border-box;
background: #FFFFFF;
border-radius: 20rpx 20rpx 0 0;
left: 0;
bottom: 0;
animation: show-sku-box .5s forwards;
z-index: 2;
padding: 44rpx 40rpx;
}
}
.goods-box {
.cover {
width: 180rpx;
height: 180rpx;
border-radius: 24rpx;
overflow: hidden;
}
.right-box {
padding-left: 40rpx;
.price-box {
font-weight: 700;
color: #FC5B32;
display: table-cell;
vertical-align: bottom;
text {
color: #FF6038;
font-size: 40rpx;
font-weight: 600;
margin-right: 4rpx;
}
.price {
font-size: 64rpx;
}
}
.stock {
font-weight: 400;
font-size: 20rpx;
color: #858A94;
margin: 10rpx 0 8rpx 0;
}
.selct-box {
font-weight: 400;
font-size: 20rpx;
color: #858A94;
}
}
}
.sku-box {
.title {
font-weight: 400;
font-size: 28rpx;
color: #1B233D;
margin-top: 48rpx;
margin-bottom: 26rpx;
}
.sku-list {
display: flex;
flex-wrap: wrap;
.sku {
padding: 6rpx 20rpx;
background: #F5F6FA;
border-radius: 12rpx;
margin-right: 16rpx;
margin-bottom: 20rpx;
}
.sku_active {
background: #fc5b320f;
border: 2rpx solid #FC5B32;
border-radius: 4rpx;
font-weight: 400;
font-size: 24rpx;
color: #FC5B32;
}
}
}
.count-box {
margin-top: 20rpx;
.title {
font-weight: 400;
font-size: 28rpx;
color: #434345;
}
.right {
.tip {
font-weight: 400;
font-size: 20rpx;
color: #F13C3D;
}
.stepper {
margin-left: 16rpx;
}
}
}
.textarea-box {
margin-top: 48rpx;
.title {
font-weight: 400;
font-size: 28rpx;
color: #4C4D4F;
margin-bottom: 20rpx;
}
.pannel {
width: 100%;
box-sizing: border-box;
padding: 16rpx 20rpx;
height: 128rpx;
background: #F5F6FA;
border-radius: 16rpx;
.textarea-placeholder {
font-weight: 400;
font-size: 24rpx;
color: #9E9EA8;
}
.textArea {
height: 100%;
}
}
}
.adress-box {
margin-top: 52rpx;
.title {
font-weight: 400;
font-size: 28rpx;
color: #1B233D;
}
.content {
font-weight: 400;
font-size: 24rpx;
color: #333435;
width: 490rpx;
text-align: right;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
margin-right: 8rpx;
}
.emptyText {
color: #858A94;
}
.pos {
width: 36rpx;
height: 36rpx;
}
}
.btn-wrap {
position: fixed;
left: 0;
right: 0;
bottom: 0;
box-sizing: border-box;
padding: 8rpx 40rpx 68rpx;
background: white;
.btn {
width: 100%;
height: 80rpx;
background: #FB8A32;
border-radius: 20rpx;
font-weight: 500;
font-size: 30rpx;
color: #FFFFFF;
}
.diable_btn{
background: #999999;
color: #FFFFFF;
border: none;
box-shadow: none;
}
}
.flex_sc {
display: flex;
align-items: center;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
\ No newline at end of file \ No newline at end of file
<!-- <van-popup show="{{ show }}" bind:click-overlay="cancel" custom-class="popclass" position="bottom" custom-style="height: 90%"></van-popup> -->
<view class="sku-container" hidden="{{!show}}">
<view class="sku-bg" bindtap="cancel"></view>
<view class="container">
<view class="goods-box flex_sc">
<view class="cover">
<glsx-image class="cover" src="{{goods.imageResponses[0].imgUrl}}" />
</view>
<view class="right-box">
<view class="price-box">
<text class="price">{{goods.salePrice || 35}}</text><text>积分</text>
</view>
<view wx:if="{{goods.goodsStock}}" class="stock">有货(库存{{goods.goodsStock}})</view>
<view wx:else class="stock">暂无存货</view>
<view class="selct-box">已选:{{goodsNumber}}{{goods.goodsUnit}}</view>
</view>
</view>
<view class="sku-box">
<view class="title">规格</view>
<view class="sku-list">
<block wx:for="{{goods.specificationResponses}}" wx:key="index">
<view class="sku flex_cc sku_active">{{item.specName}}:{{item.specValue}}</view>
</block>
</view>
</view>
<view class="count-box flex_scb">
<view class="title">数量</view>
<view class="right flex_sc">
<!-- <view class="tip">至少购买{{goods.startQty}}{{goods.goodsUnit}}</view> -->
<view class="stepper">
<stepper count="{{goodsNumber}}" min="{{goods.startQty}}" max="{{goods.goodsStock}}" catchchange="changeCount"></stepper>
</view>
</view>
</view>
<view class="textarea-box">
<view class="title">订单备注</view>
<view class="pannel">
<textarea bindinput="intRemain" maxlength="100" class="textArea" placeholder="请输入备注信息(选填)" placeholder-class="textarea-placeholder"></textarea>
</view>
</view>
<view bind:tap="toShowAddressModal" class="adress-box flex_scb">
<view class="title">收货地址</view>
<view class="right flex_scb">
<view class=" content {{defaultAds?'':'emptyText'}}">{{defaultAds || '请选择'}}</view>
<mp-icon icon="arrow" bind:tap="showSkuModal" color="#B1B1B3" size="{{10}}"></mp-icon>
</view>
</view>
<view class="btn-wrap flex_cc">
<view wx:if="{{staffShop&&!canPay}}" class="btn flex_cc diable_btn">积分不足</view>
<view wx:else bind:tap="checkLoginStatus" class="btn flex_cc">确认</view>
</view>
<view style="height:290rpx"></view>
</view>
</view>
<address wx:if="{{showAddress}}" staff="{{staffShop}}" address="{{address}}" idIndex="{{defaultAddress.id}}" bind:getAddress="getAddress" show="{{showAddress}}"></address>
<!-- <jf-modal bind:comfirmOrder="toCreatedOrder" count="{{jfCount || goods.redeemPoints}}" show="{{showJfModal}}"></jf-modal> -->
const navStyle = 'background-color: transparent;'
let navBarHeight = 38
// import { mineApi, shopmallApi } from '~/api/api'
// import MineApi from '~/api/mineApi/index'
// import NP from 'number-precision'
// import USERAPI from '~/api/usersApi/index'
Page({
data: {
navStyle,
tabs: ['商品详情', '商品参数'],
curTabIndex: 0,
service: {
1001: '不支持无理由退货',
1002: '支持7天无理由退货',
1003: '支持7天无理由退货(拆封后不支持)',
1004: '支持7天无理由退货(激活后不支持)',
1005: '支持7天无理由退货(安装后不支持)',
1006: '支持7天无理由退货(使用后不支持)',
},
skuInfo: '',
staffShop: false,
isCarOwner: false,
payWayActions: [{ name: '金额支付', type: 1, disabled: false }, { name: '积分兑换', type: 2, disabled: false }],
detailInfo: {
pointsPrice: 25,
marketPrice: 30,
imageResponses: [{
imgUrl: 'https://img02.glsx.com.cn/weapp/resource/miniprogram/points-mall/index/index-bg.png'
}],
saleNum: 600,
remaining: 56,
goodsName: '九阳保温饭盒焖烧杯九阳保温饭盒焖烧杯九阳保温饭盒焖烧杯九阳',
goodsDescribe: '<figure class="image"><img src="https://img.yunzhonghe.com/image/1592793907468wHVTWiUHIc.png"></figure>'
}
},
appHide() {
wx.offAppHide()
wx.onAppHide(() => {
if (this.timer) clearInterval(this.timer)
this.trackQuery.view = 5
})
},
/**添加埋点结束 */
navbarReady(e) {
navBarHeight = e.detail.height
},
onPageScroll(e) {
const { curTabIndex } = this.data
if (curTabIndex == 0) {
this.scrollY = e.scrollTop
}
this.setData({
navStyle: e.scrollTop >= navBarHeight || curTabIndex ? '' : navStyle,
opacity: curTabIndex == 1 ? 1 : e.scrollTop / 200,
})
},
goodsActionReady(e) {
this.setData({
padding_bottom: e.detail
})
},
goodsActionClick(e) {
if (e.detail == 'join') return this.toAddShopCar()
if (this.data.isCarOwner) return this.judgePayWay()
this.showSkuModal(e.detail)
},
onLoad(options) {
wx.p.router.getRouterParams(options).then(params => {
// this.getDetail(options)
}).catch(err => {
console.error('参数获取失败:', err)
})
// this.getPlatFormAddress(staff)
},
showSkuModal(type) {
console.log('111')
// if (this.data.isCarOwner) return
this.setData({
showSku: true,
clickType: type
})
wx.setPageStyle({
style: {
overflow: 'hidden'
}
})
},
// 获取默认的地址
getPlatFormAddress(staff) {
wx.showLoading()
let para = {}
if (staff) {
para.businessType = 1
}else{
const SID = wx.$util.getSessionId()
if (!SID) return wx.hideLoading()
}
shopmallApi.platformAddressList(para).then(data => {
wx.hideLoading()
let contactAddress = '', defaultAddress = {}
let _isSetDefault = false
if (data && data.length) {
data.forEach(el => {
if (el.isDefault == 1) {
contactAddress = el.provinceName + el.cityName + el.countyName + el.address,
defaultAddress = el
_isSetDefault = true
}
})
if (!_isSetDefault) {
let _first = data[0]
contactAddress = _first.provinceName + _first.cityName + _first.countyName + _first.address,
defaultAddress = _first
}
}
this.setData({
addressList: data,
contactAddress,
defaultAddress
})
})
},
jump(e) {
let { url, isChooseAddress } = e.currentTarget.dataset
wx.$router.go(url, {
isChooseAddress,
platform: true,
staff: this.data.staffShop,
notIntercept: this.data.staffShop
})
},
back() {
wx.$router.back()
},
changeTab(e) {
if (this.data.opacity < 0.8) return
this.setData({
curTabIndex: e.currentTarget.dataset.index,
opacity: e.currentTarget.dataset.index
}, () => {
setTimeout(() => {
wx.pageScrollTo({
scrollTop: this.scrollY
})
}, 200)
})
},
// 获取详情
getDetail(options) {
if(!options || !options.id)return
const { id, staff, score, isCarOwner, openId } = options
const merchantId = wx.$storage.get("srcm_shopmall_merchant_id");
this.merchantId = merchantId
let para = { id }, canPay = true
if (staff) para.businessType = 1
if (isCarOwner) {
if (openId) {
this.shareOpenId = options.openId
}
this.data.enter_time = new Date().format('yyyy-MM-dd hh:mm:ss')
this.firstEnter = true
this.appHide()
this.getMyIntegral()
para.merchantId = merchantId
}
shopmallApi.platformGoodsDetail(para).then(res => {
if (res && res.specificationResponses) {
this.toGetSpecString(res, res.startQty)
}
if (staff) {
canPay = score > res.redeemPoints
}
// if (isCarOwner) {
// res.retailPrice = NP.divide(res.retailPrice, 100)
// }
this.setData({
detailInfo: res || {},
canPay,
isCarOwner
})
})
},
toGetSpecString(info, count) {
let skuInfo = this.data, num = '', weight = ''
num = `${count}${info.goodsUnit}`
weight = `${info.grossWeight}${info.grossWeightUnit}`
skuInfo = `${info.specificationResponses[0].specValue}` + `,${weight}` + `,${num}`
this.setData({
skuInfo
})
},
getCount(e) {
this.toGetSpecString(this.data.detailInfo, e.detail)
this.count = e.detail
},
// 添加购物车
toAddShopCar() {
const { detailInfo, isCarOwner } = this.data
const PARAMS = {
goodsId: detailInfo.id,
goodsNumber: this.count || detailInfo.startQty,
cartType: 2,
goodsSkuCode: detailInfo.goodsSkuCode
}
if (isCarOwner) {
PARAMS.carOwnerPlatformFlag = 1
PARAMS.merchantId = this.merchantId
PARAMS.cartType = 4
}
if(isCarOwner&&!detailInfo.retailPrice&&detailInfo.exchangeIntegral)return
shopmallApi.platformAddCar(PARAMS).then(res => {
wx.$api.showToast('添加成功!在购物车等亲~')
})
},
// 同步选择的地址
resetAddress(e) {
this.setData(e.detail)
},
toDuiHuang() {
if (this.data.canPay) {
this.showSkuModal('pay')
}
},
getViewInfo() {
wx.$api.getViewInfo(
'.fixed_btn_wrap',
res => {
this.setData({
padding_bottom: res.height
})
},
this
)
},
closeSku() {
wx.setPageStyle({
style: {
overflow: 'unset'
}
})
},
//获取我的积分
getMyIntegral() {
shopmallApi.getMyIntegralApi({}).then(res => {
if (res) {
this.setData({
availableIntegral: res.availableIntegral
})
}
})
},
judgePayWay() {
const { availableIntegral, detailInfo, payWayActions } = this.data
if (detailInfo.exchangeIntegralFlag) {
const canPay = +availableIntegral > +detailInfo.exchangeIntegral
const canMoneyPay = !detailInfo.retailPrice
if (!canPay) {
payWayActions[1].disabled = true
payWayActions[1].name = '积分不足'
}
if(canMoneyPay){
payWayActions[0].disabled = true
}
this.setData({
showPayWay: true,
canPay,
payWayActions
})
} else {
this.jumpToPay()
}
},
closePayWayModal() {
this.setData({
showPayWay: false
})
},
//选择支付方式
selectPayWay(e) {
const val = e.detail
if (val.type == 2) {
this.useJFtoPay = true
} else {
this.useJFtoPay = false
}
this.jumpToPay()
this.closePayWayModal()
},
// 跳转确认支付订单页面
jumpToPay() {
const { detailInfo } = this.data
const obj = {
useJFtoPay: this.useJFtoPay,
merchantName: detailInfo.merchantName,
merchantId: detailInfo.merchantId,
goodsList: [{
goodsImage: detailInfo.imageResponses[0].imgUrl,
goodsSkuName: detailInfo.goodsSkuName,
retailPrice: detailInfo.retailPrice,
exchangeIntegral: detailInfo.exchangeIntegral,
goodsNumber: 1,
goodsStock: detailInfo.goodsStock,
goodsId: detailInfo.id,
isPay: false,
goodsSkuCode: detailInfo.goodsSkuCode,
}]
}
const query = `?goodsInfo=${JSON.stringify(obj)}`
wx.navigateTo({
url: '/packageShopmall/packageMall/pages/platformShop/pay/index' + query,
});
},
onUnload: function () {
const {
isCarOwner
} = this.data
if (!isCarOwner) return
if (this.timer) clearInterval(this.timer)
this.trackQuery.view = 5
},
onShareAppMessage: function () {
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
const userInfo = wx.$util.getUserInfo()
let {
detailInfo,
isCarOwner
} = this.data, open_id = ''
if (!isCarOwner) return
this.trackQuery.view = 4
if (userInfo) open_id = userInfo.openId
let title = detailInfo.goodsSkuName
let path = `${this.route}?id=${detailInfo.id}&openId=${open_id}`
let imageUrl = ''
detailInfo.imageResponses.map(e => {
imageUrl = e.imgUrl
})
if (merchantId) path = `${path}&merchantId=${merchantId}&isCarOwner=${isCarOwner || false}`
return {
imageUrl,
title,
path
}
},
})
\ No newline at end of file \ No newline at end of file
{
"navigationStyle": "custom",
"usingComponents":{
"mp-html":"/components/mp-html/index",
"sku": "./components/Sku"
}
}
\ No newline at end of file \ No newline at end of file
/* packageMall/pages/detail/detail.wxss */
page {
background: #F7F8FA;
}
.flex {
display: flex;
align-items: center;
position: relative;
}
.navigation-bar {
position: fixed;
top: 0;
left: 0;
z-index: 2;
.navigation {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.back {
position: absolute;
left: 20rpx;
width: 64rpx;
height: 64rpx;
background: #ffffff80;
border: 1rpx solid #E5E5E5;
border-radius: 32rpx;
}
.page-title {
font-size: 34rpx;
font-weight: 600;
color: #282829;
}
}
}
.layout {
.banner-box {
height: 750rpx;
position: relative;
.banner {
height: 100%;
}
.dot-box {
position: absolute;
bottom: 24rpx;
border-radius: 2rpx;
overflow: hidden;
display: flex;
}
.banner video {
width: 100%;
height: 100%;
}
.dot {
width: 20rpx;
height: var(--borderRadius);
background: rgba(255, 255, 255, 0.3);
transition: all .5s;
}
.dot.active {
background-color: #fff;
}
}
.goods-container {
background: #F7F8FA;
padding: 16rpx 0;
.container-item {
margin: 0 16rpx;
padding: 28rpx 24rpx;
background: #FFFFFF;
border-radius: 24rpx;
margin-bottom: 16rpx;
}
.goods-box {
.price{
display: flex;
justify-content: space-between;
}
.price-box {
display: flex;
.sale-price {
font-size: 54rpx;
color: #FC5B32;
font-weight: 700;
text {
font-size: 28rpx;
font-weight: 500;
}
}
.market-price {
text-decoration: line-through;
font-size: 24rpx;
color: #B1B1B3;
margin: 36rpx 0 0 12rpx;
}
}
.count {
color: #B1B1B3;
font-size: 24rpx;
}
.goods-title {
margin-top: 20rpx;
color: #282829;
font-size: 34rpx;
font-weight: 500;
font-family: PingFangSC-Medium;
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
word-break: break-all;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
.select-params-box {
.cell {
height: 88rpx;
display: flex;
align-items: center;
justify-content: space-between;
.flex {
width: 100%;
}
.title {
width: 80rpx;
font-size: 24rpx;
color: #707071;
}
.content {
width: calc(100% - 140rpx);
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
word-break: break-all;
}
.flex_ccc {
display: flex;
justify-content: center;
flex-direction: column;
}
}
}
.goods-detail-box {
.title {
text-align: center;
font-size: 24rpx;
color: #B1B1B3;
}
}
}
}
.tab-widget {
position: fixed;
left: 0;
right: 0;
top: 0;
background: white;
height: 88rpx;
z-index: 99;
opacity: 0;
.tab-box {
position: relative;
width: 50%;
height: 88rpx;
font-weight: 400;
font-size: 28rpx;
color: #656566;
.line {
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 66rpx;
height: 6rpx;
background: #FC5B32;
border-radius: 2rpx;
}
}
}
.fixed_btn_wrap {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 100rpx;
background: #FFFFFF;
box-sizing: border-box;
padding:4rpx 48rpx;
.dh_btn {
background: #FC5B32;
border: 1.6rpx solid #FC5B32;
box-shadow: 0 4rpx 12rpx 4rpx #f13c3d1a;
border-radius: 20rpx;
height: 80rpx;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
}
.grey_btn{
background: #999999;
border: none;
box-shadow: none;
}
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
\ No newline at end of file \ No newline at end of file
<view class="navigation-bar">
<navigation-bar custom navStyle="{{navStyle}}" bindnavbarReady="navbarReady" page-title="商品详情">
<view class="navigation">
<view class="back text-center" bindtap="back">
<mp-icon icon="back" color="#323233" size="{{12}}"></mp-icon>
</view>
<view class="page-title">商品详情</view>
</view>
</navigation-bar>
</view>
<view class="tab-widget flex_sc" style="top:{{padding_bottom}}px;opacity:{{opacity}};z-index:{{opacity>0.9?99:1}}">
<block wx:for="{{tabs}}" wx:key="index">
<view bind:tap="changeTab" data-index="{{index}}" class="tab-box flex_cc">
<text>{{item}}</text>
<view wx:if="{{curTabIndex==index}}" class="line"></view>
</view>
</block>
</view>
<view hidden="{{curTabIndex!=0}}">
<view class="layout" style="padding-bottom:{{padding_bottom + 20}}px;">
<view class="banner-box">
<swiper class="banner" bindchange="changeBanner">
<block wx:for="{{detailInfo.imageResponses}}" wx:key="index">
<swiper-item>
<glsx-image class="icon-bg" src="{{item.imgUrl}}" />
</swiper-item>
</block>
</swiper>
<block wx:if="{{detailInfo.imageResponses.length > 1}}">
<view class="dot-box x-center">
<block wx:for="{{detailInfo.imageResponses}}" wx:key="index">
<view class="dot {{bannerIndex == index ? 'active':''}}"></view>
</block>
</view>
</block>
</view>
<view class="goods-container">
<view class="container-item goods-box">
<view class="price">
<view class="price-box">
<view class="sale-price">
{{detailInfo.pointsPrice}}
<text>积分</text>
</view>
<view class="market-price">¥{{detailInfo.marketPrice}}</view>
</view>
<view class="count">
<text>剩余 {{detailInfo.remaining}}</text> | <text>销售 {{detailInfo.saleNum}}</text>
</view>
</view>
<view class="goods-title">{{detailInfo.goodsName}}</view>
</view>
<view class="container-item select-params-box">
<view class="cell">
<view class="flex">
<view class="title">已选</view>
<view bind:tap="showSkuModal" class="content flex_ccc">
<view>{{skuInfo}}</view>
</view>
</view>
<mp-icon icon="arrow" bind:tap="showSkuModal" color="#B1B1B3" size="{{12}}"></mp-icon>
</view>
<view class="cell">
<view class="flex">
<view class="title">配送</view>
<view bindtap="jump" data-is-choose-address data-url="/packageShopmall/packageMine/pages/address/index/index" class="content flex_ccc">
<view class="address-text">{{contactAddress || '--'}}</view>
</view>
</view>
<mp-icon icon="arrow" color="#B1B1B3" size="{{12}}"></mp-icon>
</view>
<view class="cell">
<view class="title">服务</view>
<view class="content flex_ccc">
<view>{{service[detailInfo.returnGoodsRules]}},包邮,正品保障</view>
</view>
</view>
</view>
<view class="goods-detail-box">
<view class="title">图文详情</view>
<view class="image-list-wrap">
<mp-html content="{{detailInfo.goodsDescribe}}"></mp-html>
</view>
</view>
</view>
</view>
</view>
<view hidden="{{curTabIndex!=1}}">
<view class="layout" style="padding-bottom:{{padding_bottom + 20}}px;">
<view class="inner" style="padding-top:{{padding_bottom+48}}px">
<view class="title">商品参数</view>
<view class="table-wrap">
<view class="cell flex_sc">
<view class="label-box flex_sc">商品编号</view>
<view class="content-box flex_sc">{{detailInfo.goodsSkuCode}}</view>
</view>
<view class="cell flex_sc">
<view class="title-box flex_sc">参数</view>
</view>
<block wx:for="{{detailInfo.attributeResponses}}" wx:key="index">
<view wx:if="{{item.attributeName}}" class="cell flex_sc">
<view class="label-box flex_sc">{{item.attributeName}}</view>
<view class="content-box flex_sc">{{item.attributeValueName}}</view>
</view>
</block>
</view>
</view>
</view>
</view>
<view wx:if="{{staffShop}}" class="fixed_btn_wrap">
<view bind:tap="toDuiHuang" class="dh_btn {{canPay?'':'grey_btn'}}">
{{canPay?'立即兑换':'积分不足'}}
</view>
</view>
<block wx:if="{{navHeight&&!staffShop}}">
<goods-action platformShop="{{true}}" bindready="goodsActionReady" pay-disabled="{{false}}" upgradeSet="{{!detailInfo.retailPrice&&detailInfo.exchangeIntegral}}" stock="{{detailInfo.goodsStock===0}}" buyFlag="{{false}}" bindclick="goodsActionClick" hideShop="{{false}}"></goods-action>
</block>
<sku staffShop="{{staffShop}}" canPay="{{canPay}}" bind:cancelSku="closeSku" bind:getCount="getCount" bind:sameAddress="resetAddress" wx:if="{{showSku}}" show="{{showSku}}" defaultAds="{{contactAddress}}" goods="{{detailInfo}}" defaultAddress="{{defaultAddress}}" address="{{addressList}}"></sku>
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
...@@ -9,5 +9,4 @@ ...@@ -9,5 +9,4 @@
<!-- 重新提交按钮组件 --> <!-- 重新提交按钮组件 -->
<re-submit-button wx:if="{{orderInfo.refundStatus >5}}" bindresubmit="confirm"></re-submit-button> <re-submit-button wx:if="{{orderInfo.refundStatus >5}}" bindresubmit="confirm"></re-submit-button>
</view> </view>
<mp-actionSheet bindactiontap="selectExpress" show="{{isShowExpressSelector}}" actions="{{expressList}}" title="选择快递公司"></mp-actionSheet>
</block> </block>
\ No newline at end of file \ No newline at end of file
{ {
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"glsx-image": "/components/image/index" "glsx-image": "/components/image/index",
"Status":"../../../components/Status/Status"
} }
} }
\ No newline at end of file \ No newline at end of file
<view class="status-box">
<!-- 退款状态1:待处理,2待发货,3待确认收到退货,4:退款中,5:已退款,6:退款失败,7:审核不通过 -->
<view class="icon">
<glsx-image webp src="{{refund.image}}"></glsx-image>
</view>
<view class="box-info">
<view class="title">{{refund.title}}</view>
<view class="tips">{{refund.tips}}</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
<Status image="{{refund.image}}" title="{{refund.title}}" tips="{{refund.tips}}"/>
\ No newline at end of file \ No newline at end of file
.status-box {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 24rpx;
margin-bottom: 32rpx;
}
.status-box .icon {
width: 80rpx;
height: 80rpx;
}
.status-box .box-info .title {
font-size: 40rpx;
font-weight: 500;
color: #282829;
}
.status-box .box-info .tips {
font-size: 28rpx;
font-weight: 400;
color: #656566;
}
\ No newline at end of file \ No newline at end of file
...@@ -10,10 +10,6 @@ Page({ ...@@ -10,10 +10,6 @@ Page({
imgUrls: [], imgUrls: [],
RefundReason: Object.freeze(RefundReason), RefundReason: Object.freeze(RefundReason),
}, },
previewImage(e) {
let params = e.currentTarget.dataset;
wx.p.wxApi.previewImage(params);
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
...@@ -28,16 +24,6 @@ Page({ ...@@ -28,16 +24,6 @@ Page({
}); });
}); });
}, },
showPopup() {
this.setData({
showPopup: true,
});
},
confirmPopup() {
this.setData({
showPopup: false,
});
},
input(e) { input(e) {
this.setData({ this.setData({
"orderObj.remark": e.detail.value, "orderObj.remark": e.detail.value,
...@@ -45,37 +31,22 @@ Page({ ...@@ -45,37 +31,22 @@ Page({
}, },
changeRefundCount(e) { changeRefundCount(e) {
this.setData({ this.setData({
"orderObj.refundCount": e.detail "orderObj.refundCount": e.detail.value
}); });
}, },
radioChange(e){ radioChange(e){
const value = e.currentTarget.dataset.item.value const value = e.detail.item.value
this.setData({ this.setData({
"orderObj.reason": value, "orderObj.reason": value,
refundReason:RefundReason.find(item => item.value == value).text
}); });
}, },
noScroll() {},
showRefundCount() { showRefundCount() {
this.setData({ this.setData({
showRefundCount: true, showRefundCount: true,
}); });
}, },
blur(e) {
const rex = /^(([1-9]{1}\d*)|(0{1}))(\.\d{2})$/;
console.log(e);
let { value } = e.detail;
let { maxPrice } = this.data;
if (value > maxPrice) value = maxPrice;
if (value < 0) value = 0;
if (!rex.test(value)) value = maxPrice;
this.setData({
"orderObj.refundPrice": Number(value).toFixed(2),
showPriceInput: false,
});
},
del(e) { del(e) {
let { index } = e.currentTarget.dataset; let { index } = e.detail;
let { imgUrls } = this.data; let { imgUrls } = this.data;
imgUrls.splice(index, 1); imgUrls.splice(index, 1);
this.setData({ this.setData({
...@@ -129,33 +100,4 @@ Page({ ...@@ -129,33 +100,4 @@ Page({
} }
}); });
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
}); });
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
"navigationBarTitleText": "申请售后", "navigationBarTitleText": "申请售后",
"usingComponents": { "usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea", "gl-textarea": "/components/GlTextarea/GlTextarea",
"afterSale_step_one":"../afterSale_step_one/afterSale_step_one", "afterSale_step_one": "/packageMine/pages/order/afterSale_step_one/afterSale_step_one",
"Stepper": "/components/Stepper/Stepper" "refund-info-box": "./components/RefundInfoBox/RefundInfoBox",
"description-box": "./components/DescriptionBox/DescriptionBox",
"image-upload-box": "./components/ImageUploadBox/ImageUploadBox"
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,26 +10,6 @@ ...@@ -10,26 +10,6 @@
color: #1b233d; color: #1b233d;
} }
.page-section {
max-height: calc(100%);
overflow: hidden;
overflow-y: scroll;
.weui-cell {
height: 88rpx;
line-height: 88rpx;
font-size: 28rpx;
color: #333435;
box-sizing: border-box;
.weui-cell__hd {
margin-left: 10rpx;
margin-right: 20rpx;
line-height: 0;
}
&::before {
display: none;
}
}
}
.box { .box {
background: #ffffff; background: #ffffff;
...@@ -73,12 +53,6 @@ ...@@ -73,12 +53,6 @@
} }
} }
.type {
height: 104rpx;
background: #eff0f2;
border-radius: 8rpx;
font-size: 40rpx;
}
.description { .description {
height: 460rpx; height: 460rpx;
...@@ -86,83 +60,6 @@ ...@@ -86,83 +60,6 @@
padding: 28rpx 32rpx; padding: 28rpx 32rpx;
} }
.price-box {
height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
margin: 24rpx 0 8rpx;
box-sizing: border-box;
padding: 0 32rpx;
}
.price-box .value {
font-size: 24rpx;
color: var(--btnColor);
display: flex;
align-items: center;
}
.price-box .value .price {
margin-right: 28rpx;
font-size: 36rpx;
}
.upload-box {
min-height: 260rpx;
box-sizing: border-box;
padding: 30rpx 0 0 22rpx;
}
.upload-box .one {
width: 100%;
height: 260rpx;
}
.upload-box.flex {
display: flex;
flex-wrap: wrap;
}
.upload-box .icon {
width: 84rpx;
height: 64rpx;
}
.upload-box .item {
width: 200rpx;
height: 200rpx;
background: #F5F5F7;
margin-bottom: 30rpx;
margin-right: 20rpx;
border-radius: 8px;
position: relative;
padding: 1rpx;
.del {
position: absolute;
width: 16rpx;
height: 16rpx;
right: 2rpx;
top: -22rpx;
.icon {
width: 36rpx;
height: 36rpx;
}
}
.image{
border-radius: 8px;
}
}
.upload-box .upload-item {
background-color: #fff;
border: 2rpx solid #d8d8d8;
box-sizing: border-box;
border: 1px dashed #c9cacc;
border-radius: 8px;
position: relative;
}
.btn { .btn {
margin: 48rpx 16rpx; margin: 48rpx 16rpx;
height: 80rpx; height: 80rpx;
...@@ -173,22 +70,3 @@ ...@@ -173,22 +70,3 @@
color: #fff; color: #fff;
} }
.price-input-box {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
background-color: rgba(0, 0, 0, 0.7);
}
.price-input {
width: 100%;
height: 72rpx;
background-color: #fff;
box-sizing: border-box;
padding: 0 40rpx;
display: flex;
align-items: center;
}
...@@ -4,74 +4,31 @@ ...@@ -4,74 +4,31 @@
<afterSale_step_one /> <afterSale_step_one />
<!-- </view> --> <!-- </view> -->
<view class="title">申请退货退款</view> <view class="title">申请退货退款</view>
<view class="box">
<view class="box-item"> <!-- 退款信息组件 -->
<text class="box-item-title">退款原因</text> <refund-info-box
<view class="box-item-value" bindtap="showPopup"> refund-count="{{orderObj.refundCount}}"
{{refundReason||'请选择'}} max-refund-count="{{maxRefundCount}}"
<view class="arrow"> refund-price="{{orderObj.refundPrice}}"
<mp-icon icon="arrow" color="#B1B1B3" size="{{10}}"></mp-icon> show-refund-count="{{showRefundCount}}"
</view> bindconfirmpopup="confirmPopup"
</view> bindchangerefundcount="changeRefundCount"
</view> bindradiochange="radioChange">
<view class="box-item"> </refund-info-box>
<text class="box-item-title">数量</text>
<view class="box-item-value">
<view class="value" bindtap="showRefundCount" wx:if="{{!showRefundCount}}">
<view class="price">{{orderObj.refundCount}}件</view>
修改数量
</view>
<Stepper wx:else count="{{orderObj.refundCount}}" min="1" max="{{maxRefundCount}}" bindchange="changeRefundCount" data-index="{{index}}"></Stepper>
</view>
</view>
<view class="box-item">
<text class="box-item-title">退款金额</text>
<view class="refund">{{orderObj.refundPrice}}积分</view>
</view>
</view>
<view class="title">申请描述</view> <view class="title">申请描述</view>
<!-- 描述信息组件 -->
<view class="description box"> <view class="description box">
<gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{orderObj.remark}}" bindinput="input" showWordLimit customMaxLength></gl-textarea> <gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{remark}}" bindinput="input" showWordLimit customMaxLength></gl-textarea>
</view> </view>
<view class="title">上传图片</view> <view class="title">上传图片</view>
<view class="upload-box box flex">
<block wx:if="{{imgUrls.length < 1}}"> <!-- 图片上传组件 -->
<view class="one text-center" bindtap="upLoad"> <image-upload-box img-urls="{{imgUrls}}" bindpreviewimage="previewImage" binddel="del" bindupload="upLoad"></image-upload-box>
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</view>
</view>
</block>
<block wx:else>
<block wx:if="{{imgUrls.length < 5}}">
<view class="upload-item item text-center" bindtap="upLoad">
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</view>
</view>
</block>
<block wx:for="{{imgUrls}}" wx:key="index">
<view class="item" catchtap="previewImage" data-current="{{item}}" data-urls="{{imgUrls}}">
<image webp src="{{item}}" mode="aspectFill" class="image"></image>
<view class="del" catchtap="del" data-index="{{index}}">
<view class="icon">
<mp-icon icon="close2" color="#D8D8D8" type="field" size="{{16}}"></mp-icon>
</view>
</view>
</view>
</block>
</block>
</view>
<view class="btn text-center" bindtap="submit">提交</view> <view class="btn text-center" bindtap="submit">提交</view>
</view> </view>
<popup show="{{showPopup}}" only="{{false}}" title="请选择退款原因" bindconfirm="confirmPopup">
<view class="page-section">
<label class="weui-cell weui-check__label" wx:for="{{RefundReason}}" wx:key="{{item.value}}" bindtap="radioChange" data-item="{{item}}">
<view class="weui-cell__hd">
<icon type="{{refundReason == item.text?'success':'circle'}}" size="40rpx" color="{{refundReason == item.text?'#FB8A32':'#E3E3E6'}}"></icon>
</view>
<view class="weui-cell__bd">{{item.text}}</view>
</label>
</view>
</popup>
<glsx-privacy appletName="海马刀"></glsx-privacy> <glsx-privacy appletName="海马刀"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
Component({
properties: {
remark: {
type: String,
value: ''
}
},
methods: {
onInput(e) {
this.triggerEvent('input', { value: e.detail.value });
}
}
});
\ No newline at end of file \ No newline at end of file
{ {
"component": true,
"usingComponents": { "usingComponents": {
}, "gl-textarea": "/components/GlTextarea/GlTextarea"
"component": true }
} }
\ No newline at end of file \ No newline at end of file
<view class="description box">
<gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{remark}}" bindinput="onInput" showWordLimit customMaxLength></gl-textarea>
</view>
\ No newline at end of file \ No newline at end of file
.description {
height: 460rpx;
box-sizing: border-box;
padding: 28rpx 32rpx;
}
.box {
background: #ffffff;
border-radius: 16rpx;
}
\ No newline at end of file \ No newline at end of file
Component({
properties: {
imgUrls: {
type: Array,
value: []
}
},
methods: {
previewImage(e) {
let params = e.currentTarget.dataset;
wx.p.wxApi.previewImage(params);
},
onDel(e) {
this.triggerEvent('del', { index: e.currentTarget.dataset.index });
},
onUpload() {
this.triggerEvent('upload');
}
}
});
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"glsx-image": "/components/image/index",
"mp-icon": "weui-miniprogram/icon/icon"
}
}
\ No newline at end of file \ No newline at end of file
<view class="upload-box box flex">
<block wx:if="{{imgUrls.length < 1}}">
<view class="one text-center" bindtap="onUpload">
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</view>
</view>
</block>
<block wx:else>
<block wx:if="{{imgUrls.length < 5}}">
<view class="upload-item item text-center" bindtap="onUpload">
<view class="icon">
<glsx-image webp src="mine/camera.png"></glsx-image>
</view>
</view>
</block>
<block wx:for="{{imgUrls}}" wx:key="index">
<view class="item" catchtap="previewImage" data-current="{{item}}" data-urls="{{imgUrls}}">
<image webp src="{{item}}" mode="aspectFill" class="image"></image>
<view class="del" catchtap="onDel" data-index="{{index}}">
<view class="icon">
<mp-icon icon="close2" color="#D8D8D8" type="field" size="{{16}}"></mp-icon>
</view>
</view>
</view>
</block>
</block>
</view>
\ No newline at end of file \ No newline at end of file
.upload-box {
min-height: 260rpx;
box-sizing: border-box;
padding: 30rpx 0 0 22rpx;
}
.upload-box .one {
width: 100%;
height: 260rpx;
}
.upload-box.flex {
display: flex;
flex-wrap: wrap;
}
.upload-box .icon {
width: 84rpx;
height: 64rpx;
}
.upload-box .item {
width: 200rpx;
height: 200rpx;
background: #F5F5F7;
margin-bottom: 30rpx;
margin-right: 20rpx;
border-radius: 8px;
position: relative;
padding: 1rpx;
}
.upload-box .item .del {
position: absolute;
width: 16rpx;
height: 16rpx;
right: 2rpx;
top: -22rpx;
}
.upload-box .item .del .icon {
width: 36rpx;
height: 36rpx;
}
.upload-box .item .image {
border-radius: 8px;
}
.upload-box .upload-item {
background-color: #fff;
border: 2rpx solid #d8d8d8;
box-sizing: border-box;
border: 1px dashed #c9cacc;
border-radius: 8px;
position: relative;
}
.box {
background: #ffffff;
border-radius: 16rpx;
}
\ No newline at end of file \ No newline at end of file
import { RefundReason } from "~/constants/mine.js";
Component({
properties: {
refundCount: {
type: Number,
value: 0,
},
maxRefundCount: {
type: Number,
value: 0,
},
refundPrice: {
type: String,
value: "",
},
showRefundCount: {
type: Boolean,
value: false,
},
},
data: {
showPopup: false,
index: 0,
RefundReasonList: Object.freeze(RefundReason),
},
methods: {
onShowPopup() {
this.setData({
showPopup: true,
});
},
onConfirmPopup() {
this.setData({
showPopup: false,
});
this.triggerEvent("confirmpopup");
},
onShowRefundCount() {
this.setData({
showRefundCount: true,
});
},
onChangeRefundCount(e) {
this.triggerEvent("changerefundcount", { value: e.detail });
},
onRadioChange(e) {
const item = e.currentTarget.dataset.item;
this.setData({
refundReason: RefundReason.find((item) => item.value == value).text,
});
this.triggerEvent("radiochange", { item });
},
},
});
{
"component": true,
"usingComponents": {
"popup": "/components/Popup/Popup",
"mp-icon": "weui-miniprogram/icon/icon",
"Stepper": "/components/Stepper/Stepper"
}
}
\ No newline at end of file \ No newline at end of file
.box {
background: #ffffff;
border-radius: 16rpx;
}
.box .box-item {
display: flex;
height: 100rpx;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
}
.box .box-item .box-item-title {
font-weight: 500;
font-size: 28rpx;
color: #333;
}
.box .box-item .box-item-value {
font-weight: 400;
font-size: 28rpx;
color: #6e6e7a;
display: flex;
}
.box .box-item .box-item-value .arrow {
margin-left: 16rpx;
}
.box .box-item .box-item-value .value {
display: inline;
font-weight: 400;
font-size: 24rpx;
color: var(--themeColor);
}
.box .box-item .box-item-value .price {
display: inline;
color: #1b233d;
margin-right: 20rpx;
}
.box .box-item .refund {
color: var(--themeColor);
font-size: 36rpx;
font-weight: 700;
}
.page-section {
max-height: calc(100%);
overflow: hidden;
overflow-y: scroll;
padding: 0 20rpx;
.weui-cell {
height: 88rpx;
line-height: 88rpx;
font-size: 28rpx;
color: #333435;
box-sizing: border-box;
display: flex;
align-items: center;
.weui-cell__hd {
margin-left: 10rpx;
margin-right: 20rpx;
line-height: 0;
}
&::before {
display: none;
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="box">
<view class="box-item">
<text class="box-item-title">退款原因</text>
<view class="box-item-value" bindtap="onShowPopup">
{{refundReason||'请选择'}}
<view class="arrow">
<mp-icon icon="arrow" color="#B1B1B3" size="{{10}}"></mp-icon>
</view>
</view>
</view>
<view class="box-item">
<text class="box-item-title">数量</text>
<view class="box-item-value">
<view class="value" bindtap="onShowRefundCount" wx:if="{{!showRefundCount}}">
<view class="price">{{refundCount}}件</view>
修改数量
</view>
<Stepper wx:else count="{{refundCount}}" min="1" max="{{maxRefundCount}}" bindchange="onChangeRefundCount" data-index="{{index}}"></Stepper>
</view>
</view>
<view class="box-item">
<text class="box-item-title">退款金额</text>
<view class="refund">{{refundPrice}}积分</view>
</view>
</view>
<popup show="{{showPopup}}" only="{{false}}" title="请选择退款原因" bindconfirm="onConfirmPopup">
<view class="page-section">
<label class="weui-cell weui-check__label" wx:for="{{RefundReasonList}}" wx:key="{{item.value}}" bindtap="onRadioChange" data-item="{{item}}">
<view class="weui-cell__hd">
<icon type="{{refundReason == item.text?'success':'circle'}}" size="40rpx" color="{{refundReason == item.text?'#FB8A32':'#E3E3E6'}}"></icon>
</view>
<view class="weui-cell__bd">{{item.text}}</view>
</label>
</view>
</popup>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/components/bottom/bottom.js
Component({
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"style": "v2"
}
\ No newline at end of file \ No newline at end of file
<view class="block">
<slot></slot>
</view>
\ No newline at end of file \ No newline at end of file
.block{
border-radius: 16rpx;
background-color: #fff;
padding: var(--margin);
margin-bottom: 20rpx;
}
\ No newline at end of file \ No newline at end of file
import { RefundStatus } from "~/constants/mine.js";
Component({
properties: {
title: {
type: String,
value: ""
},
tips: {
type: String,
value: ""
},
image: {
type: String,
value: ""
}
}
});
{
"component": true,
"usingComponents": {
"glsx-image": "/components/image/index"
}
}
\ No newline at end of file \ No newline at end of file
<view class="status-box">
<view class="icon">
<glsx-image webp src="{{image}}"></glsx-image>
</view>
<view class="box-info">
<view class="title">{{title}}</view>
<view class="tips">{{tips}}</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
.status-box {
display: flex;
justify-content: flex-start;
align-items: center;
gap: 24rpx;
}
.status-box .icon {
width: 80rpx;
height: 80rpx;
}
.status-box .box-info .title {
font-size: 36rpx;
font-weight: 500;
color: #282829;
}
.status-box .box-info .tips {
font-size: 28rpx;
font-weight: 400;
color: #656566;
}
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/index/components/bottom/bottom.js
Component({
properties: {
title: {
type: String,
value: "",
},
},
});
{
"component": true,
"style": "v2",
"usingComponents": {
"BlockBox": "../BlockBox/BlockBox"
}
}
\ No newline at end of file \ No newline at end of file
<BlockBox>
<view>
<view class="box-title">{{title}}</view>
<slot></slot>
</view>
</BlockBox>
\ No newline at end of file \ No newline at end of file
.box-title{
color: #1B233D;
font-size: 32rpx;
font-weight: 500;
margin-bottom: 24rpx;
}
\ No newline at end of file \ No newline at end of file
const { mockDeliveryInfoData } = require('./mock.js');
Component({
options: {
addGlobalClass: true,
styleIsolation: 'apply-shared', // 启用样式隔离并共享样式
},
properties: {
orderInfo: {
type: Object,
value: {}
},
deliveryStatus: {
type: Object,
value: {}
}
},
data: {
// Mock数据用于开发和测试
...mockDeliveryInfoData
},
methods: {
}
})
\ No newline at end of file \ No newline at end of file
<block wx:if="{{orderInfo.deliveryCompany}}">
<view class="title">发货信息</view>
<view class="item">
<view class="label">物流信息:</view>
<view class="value">{{orderInfo.deliveryCompany || ''}}{{orderInfo.deliveryNumber || ''}}</view>
</view>
<view class="item">
<view class="label">物流进度:</view>
<view class="value">
{{deliveryStatus[orderInfo.deliveryStatus]}}
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
/* 发货信息组件样式 */
.title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.item {
display: flex;
align-items: center;
font-size: 24rpx;
min-height: 48rpx;
line-height: 48rpx;
}
.item .label {
width: 150rpx;
}
.item .value {
width: calc(100% - 150rpx);
color: #656566;
}
\ No newline at end of file \ No newline at end of file
const mockDeliveryInfoData = {
orderInfo: {
deliveryCompany: '顺丰快递',
deliveryNumber: 'SF1234567890',
deliveryStatus: 2
},
deliveryStatus: {
1: "待发货",
2: "已发货",
3: "已收货",
}
};
module.exports = {
mockDeliveryInfoData
};
\ No newline at end of file \ No newline at end of file
const { mockOrderAmountData } = require('./mock.js');
Component({
options: {
addGlobalClass: true,
styleIsolation: 'apply-shared'
},
properties: {
orderInfo: {
type: Object,
value: {}
}
},
data: {
// Mock数据用于开发和测试
...mockOrderAmountData
},
methods: {
}
})
\ No newline at end of file \ No newline at end of file
/* 订单金额组件样式 */
.title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.price-item {
height: 60rpx;
display: flex;
justify-content: space-between;
align-items: center;
color: #7A8299;
font-size: 26rpx;
font-weight: 400;
.price {
color: #282829;
font-size: 28rpx;
font-weight: 600;
}
}
.price-item.line {
border-bottom: 1rpx solid #f0f1f5;
margin-bottom: 30rpx;
}
.price-item .unit,
.price-item .sum,
.price-item .amount {
color: var(--btnColor);
font-weight: 600;
}
.price-item .amount {
font-size: 36rpx;
.unit {
font-size: 20rpx;
}
}
.price-item .sum {
font-size: 48rpx;
.unit {
font-size: 24rpx;
}
}
<view wx:if="{{orderInfo.orderSource!=5}}">
<view class="title">订单金额</view>
<view class="price-item">
商品总价
<view class="amount">{{orderInfo.orderPrice}} <text class="unit">积分</text></view>
</view>
<view class="price-item line">
运费
<view class="price">包邮</view>
</view>
<view class="price-item">
<view></view>
<view class="price sum">{{orderInfo.payPrice}} <text class="unit">积分</text></view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
const mockOrderAmountData = {
orderInfo: {
orderSource: 1,
orderPrice: '278.00',
expressFee: '0.00',
payPrice: '278.00'
}
};
module.exports = {
mockOrderAmountData
};
\ No newline at end of file \ No newline at end of file
const { mockOrderGoodsData } = require('./mock.js');
Component({
options: {
addGlobalClass: true,
styleIsolation: 'isolated'
},
properties: {
orderInfo: {
type: Object,
value: {}
}
},
data: {
// Mock数据用于开发和测试
...mockOrderGoodsData
},
methods: {
}
})
\ No newline at end of file \ No newline at end of file
{ {
"usingComponents": {
},
"component": true "component": true
} }
\ No newline at end of file \ No newline at end of file
<view class="title">订单商品</view>
<block wx:key="index" wx:for="{{orderInfo.orderGoods}}">
<view class="goods">
<view class="icon">
<image webp src="{{orderInfo.orderSource == 5?orderInfo.activityBigImg:item.goodsImage}}"></image>
</view>
<view class="info">
<view>
<view class="name text-hide">{{orderInfo.orderSource == 5?orderInfo.activityName:item.goodsName}}</view>
<view class="specification">{{item.specificationData || ''}}</view>
</view>
<view class="price">
¥{{orderInfo.orderSource == 5?orderInfo.payPrice:(item.activityPrice || item.retailPrice)}}
<view class="count">x{{orderInfo.orderSource == 5? 1: item.goodsNumber}}</view>
</view>
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
/* 订单商品组件样式 */
.title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.merchantName.text-hide {
/* 文本隐藏样式应该在全局样式中定义 */
}
.goods {
margin-top: 40rpx;
display: flex;
align-items: center;
height: 160rpx;
}
.goods .icon {
width: 160rpx;
height: 100%;
overflow: hidden;
border-radius: var(--borderRadius);
margin-right: 20rpx;
}
.goods .info {
width: calc(100% - 180rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.goods .info .name {
font-size: 30rpx;
color: #333;
}
.goods .info .specification {
font-size: 24rpx;
color: #B1B1B3;
}
.goods .info .price {
display: flex;
justify-content: space-between;
color: var(--btnColor);
font-weight: 500;
}
.goods .info .price .count {
color: #656566;
font-weight: normal;
}
\ No newline at end of file \ No newline at end of file
const mockOrderGoodsData = {
orderInfo: {
merchantName: '官方旗舰店',
orderSource: 1,
activityBigImg: '',
activityName: '',
orderGoods: [
{
goodsImage: 'https://picsum.photos/200/200',
goodsName: '商品名称1 商品描述信息 商品型号等详细信息',
specificationData: '颜色:红色;尺寸:XL;套餐:标配',
retailPrice: '99.00',
activityPrice: '89.00',
goodsNumber: 2
},
{
goodsImage: 'https://picsum.photos/200/200',
goodsName: '商品名称2 商品描述信息 商品型号等详细信息',
specificationData: '颜色:蓝色;尺寸:L;套餐:标配',
retailPrice: '199.00',
activityPrice: '179.00',
goodsNumber: 1
}
]
}
};
module.exports = {
mockOrderGoodsData
};
\ No newline at end of file \ No newline at end of file
const { mockOrderInfoData } = require('./mock.js');
Component({
options: {
addGlobalClass: true,
styleIsolation: 'isolated'
},
properties: {
orderInfo: {
type: Object,
value: {}
},
orderObj: {
type: Array,
value: []
},
statusEnum: {
type: Object,
value: {}
}
},
data: {
// Mock数据用于开发和测试
...mockOrderInfoData
},
methods: {
}
})
\ No newline at end of file \ No newline at end of file
<view class="title">订单信息</view>
<block wx:for="{{orderObj}}" wx:key="index">
<view class="item {{item.alignItems}}">
<view class="label">{{item.label}}:</view>
<view class="value">
<block wx:if="{{item.enum}}">
{{statusEnum[orderInfo[item.key]]|| ''}}
</block>
<block wx:else>{{orderInfo[item.key] || ''}}</block>
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
/* 订单信息组件样式 */
.title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.item {
display: flex;
align-items: center;
font-size: 24rpx;
min-height: 48rpx;
line-height: 48rpx;
}
.item.flex-start {
align-items: flex-start;
}
.item .label {
width: 150rpx;
}
.item .value {
width: calc(100% - 150rpx);
color: #656566;
}
\ No newline at end of file \ No newline at end of file
const mockOrderInfoData = {
orderInfo: {
time: '2023.05.15 14:30:22',
orderCode: '20230515143022001',
shipAddress: '北京市朝阳区某某街道某某小区1号楼101室',
orderStatus: 3
},
orderObj: [
{
label: "下单日期",
key: "time",
},
{
label: "订单编号",
key: "orderCode",
},
{
label: "收货地址",
key: "shipAddress",
alignItems: "flex-start",
},
{
label: "订单状态",
key: "orderStatus",
enum: true,
},
],
statusEnum: {
1: "待付款",
2: "待发货",
3: "已发货",
4: "已完成",
5: "已取消"
}
};
module.exports = {
mockOrderInfoData
};
\ No newline at end of file \ No newline at end of file
import { wxqrcode as QR } from "~/lib/index"; import { wxqrcode as QR } from "~/lib/index";
import { orderMixin } from "~/mixins/index"; import { orderMixin } from "~/mixins/index";
import { iosTimeFormat } from "~/utils/format"; import { iosTimeFormat } from "~/utils/format";
import { mockOrderDetailData } from "./mock.js";
import { OrderStatus } from "~/constants/mine.js";
Page({ Page({
behaviors: [orderMixin], behaviors: [orderMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
// 使用mock数据用于开发和测试
...mockOrderDetailData,
OrderStatus,
couponsList: [], couponsList: [],
orderObj: [ orderObj: [
{ {
...@@ -42,6 +47,9 @@ Page({ ...@@ -42,6 +47,9 @@ Page({
if (orderCode) { if (orderCode) {
this.getOrderDetail(orderCode); this.getOrderDetail(orderCode);
} }
this.setData({
Status: OrderStatus[this.data.orderInfo.orderStatus],
});
}); });
}, },
getOrderDetail(orderCode) { getOrderDetail(orderCode) {
......
{ {
"navigationBarTitleText": "订单详情" "navigationBarTitleText": "订单详情",
"usingComponents": {
"Status":"../components/Status/Status",
"BlockBox": "../components/BlockBox/BlockBox",
"TitleBox":"../components/TitleBox/TitleBox",
"DeliveryInfo": "./components/DeliveryInfo/DeliveryInfo",
"OrderInfo": "./components/OrderInfo/OrderInfo",
"OrderGoods": "./components/OrderGoods/OrderGoods",
"OrderAmount": "./components/OrderAmount/OrderAmount",
"content": "/packageMine/pages/order/index/components/Content/Content"
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -9,117 +9,24 @@ ...@@ -9,117 +9,24 @@
color: #2C2C2C; color: #2C2C2C;
margin-bottom: 6rpx; margin-bottom: 6rpx;
} }
.status-box .icon{
.status-box .icon {
width: 50rpx; width: 50rpx;
height: 52rpx; height: 52rpx;
margin-right: 12rpx; margin-right: 12rpx;
} }
.box { .box {
background-color: #fff; background-color: #fff;
border-radius: var(--borderRadius); border-radius: var(--borderRadius);
margin-top: 20rpx; margin-top: 20rpx;
padding: 24rpx 24rpx 40rpx; padding: 24rpx 24rpx 40rpx;
} }
.box:first-of-type{
margin-top: 0;
}
.box .title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.box .item {
display: flex;
align-items: center;
font-size: 24rpx;
min-height: 48rpx;
line-height: 48rpx;
}
.box .item.flex-start {
align-items: flex-start;
}
.box .item .label {
width: 150rpx;
}
.box .item .value {
width: calc(100% - 150rpx);
color: #656566;
}
.box .goods { .box:first-of-type {
margin-top: 40rpx; margin-top: 0;
display: flex;
align-items: center;
height: 160rpx;
}
.box .goods .icon {
width: 160rpx;
height: 100%;
overflow: hidden;
border-radius: var(--borderRadius);
margin-right: 20rpx;
}
.box .goods .info {
width: calc(100% - 180rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.box .goods .info .name {
font-size: 30rpx;
color: #333;
}
.box .goods .info .specification{
font-size: 24rpx;
color: #B1B1B3;
}
.box .goods .info .price {
display: flex;
justify-content: space-between;
color: var(--btnColor);
font-weight: 500;
font-weight: 500;
}
.box .goods .info .price .count {
color: #656566;
font-weight: normal;
}
.price-item {
height: 60rpx;
display: flex;
justify-content: space-between;
align-items: center;
color: #656566;
font-size: 24rpx;
}
.price-item.line {
border-bottom: 2rpx solid #E3E3E6;
margin-bottom: 12rpx;
} }
.price-item .price {
font-size: 28rpx;
color: var(--btnColor);
font-weight: 500;
}
.price-item .sum{
font-size: 34rpx;
font-weight: 500;
}
.price-item .unit{
font-size: 28rpx;
}
.discounts { .discounts {
position: relative; position: relative;
} }
...@@ -138,6 +45,7 @@ ...@@ -138,6 +45,7 @@
top: 50%; top: 50%;
transform: translate(0, -50%); transform: translate(0, -50%);
} }
.qr-box { .qr-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -176,19 +84,22 @@ ...@@ -176,19 +84,22 @@
box-sizing: border-box; box-sizing: border-box;
background-size: cover; background-size: cover;
} }
.box_wrapper .bg{
.box_wrapper .bg {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.box_wrapper .info{
.box_wrapper .info {
position: relative; position: relative;
z-index: 2; z-index: 2;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.left_icon_box { .left_icon_box {
width: 156rpx; width: 156rpx;
height: 156rpx; height: 156rpx;
...@@ -296,20 +207,25 @@ ...@@ -296,20 +207,25 @@
color: #B1B1B3; color: #B1B1B3;
font-size: 24rpx; font-size: 24rpx;
} }
.brightColor { .brightColor {
color: var(--btnColor); color: var(--btnColor);
} }
.darkColor { .darkColor {
color: #6D6D6D; color: #6D6D6D;
} }
.describeColor { .describeColor {
color: #D83C14; color: #D83C14;
} }
.discount { .discount {
font-size: 20rpx; font-size: 20rpx;
font-weight: 500; font-weight: 500;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.leftMargin { .leftMargin {
padding-left: 32rpx; padding-left: 32rpx;
} }
<block wx:if="{{orderInfo}}"> <block wx:if="{{orderInfo}}">
<view class="layout"> <view class="layout">
<view class="box"> <BlockBox>
<view class="status-box text-center"> <Status title="{{Status.title}}" image="{{Status.image}}" tips="{{Status.tips}}"></Status>
<view class="icon"> </BlockBox>
<!-- // 订单状态(1:待付款;2:已支付;3:已关闭;4:已发货;5:已收货;6:待审核;7:审核通过;8:审核不通过;9:待确认收到退货;10:退款中;11:已退款;12:退款失败) --> <BlockBox>
<block wx:if="{{orderInfo.orderStatus == 1||orderInfo.orderStatus == 13||orderInfo.orderStatus==14}}"> <DeliveryInfo orderInfo="{{orderInfo}}" deliveryStatus="{{deliveryStatus}}"></DeliveryInfo>
<glsx-image webp src="mine/order-wait.png"></glsx-image> </BlockBox>
</block> <BlockBox>
<block wx:elif="{{orderInfo.orderStatus == 2||orderInfo.orderStatus == 4 }}"> <OrderInfo orderInfo="{{orderInfo}}" orderObj="{{orderObj}}" statusEnum="{{statusEnum}}"></OrderInfo>
<glsx-image webp src="mine/order-receiving.png"></glsx-image> </BlockBox>
</block> <BlockBox>
<block wx:elif="{{orderInfo.orderStatus == 5||orderInfo.orderStatus == 15}}"> <OrderInfo orderInfo="{{orderInfo}}" orderObj="{{orderObj}}" statusEnum="{{statusEnum}}"></OrderInfo>
<glsx-image webp src="mine/order-success.png"></glsx-image> </BlockBox>
</block> <BlockBox>
<block wx:else> <!-- <OrderGoods orderInfo="{{orderInfo}}"></OrderGoods> -->
<glsx-image webp src="mine/order-lose.png"></glsx-image> <content item="{{orderInfo}}" />
</block> </BlockBox>
</view> <BlockBox>
{{statusEnum[orderInfo.orderStatus]}} <OrderAmount orderInfo="{{orderInfo}}"></OrderAmount>
</view> </BlockBox>
<block wx:if="{{orderInfo.deliveryCompany}}">
<view class="title">发货信息</view>
<view class="item">
<view class="label">物流信息:</view>
<view class="value">{{orderInfo.deliveryCompany || ''}}{{orderInfo.deliveryNumber || ''}}</view>
</view>
<view class="item">
<view class="label">物流进度:</view>
<view class="value">
{{deliveryStatus[orderInfo.deliveryStatus]}}
</view>
</view>
</block>
</view>
<view class="box">
<view class="title">订单信息</view>
<block wx:for="{{orderObj}}" wx:key="index">
<view class="item {{item.alignItems}}">
<view class="label">{{item.label}}:</view>
<view class="value">
<block wx:if="{{item.enum}}">
{{statusEnum[orderInfo[item.key]]|| ''}}
</block>
<block wx:else>{{orderInfo[item.key] || ''}}</block>
</view>
</view>
</block>
</view>
<view class=" box">
<view class="title">订单商品</view>
<view class="merchantName text-hide">
{{orderInfo.merchantName}}
</view>
<block wx:key="index" wx:for="{{orderInfo.orderGoods}}">
<view class="goods">
<view class="icon">
<image webp src="{{orderInfo.orderSource == 5?orderInfo.activityBigImg:item.goodsImage}}"></image>
</view>
<view class="info">
<view>
<view class="name text-hide">{{orderInfo.orderSource == 5?orderInfo.activityName:item.goodsName}}</view>
<view class="specification">{{item.specificationData || ''}}</view>
</view>
<view class="price">
¥{{orderInfo.orderSource == 5?orderInfo.payPrice:(item.activityPrice || item.retailPrice)}}
<view class="count">x{{orderInfo.orderSource == 5? 1: item.goodsNumber}}</view>
</view>
</view>
</view>
</block>
</view>
<view class="box" wx:if="{{orderInfo.orderSource!=5}}">
<view class="title">订单金额</view>
<view class="price-item">
商品总价:
<view class="price"><text class="unit">¥</text>{{orderInfo.orderPrice}}</view>
</view>
<view class="price-item line">
运费:
<view class="price"><text class="unit">¥</text>{{orderInfo.expressFee}}</view>
</view>
<view class="price-item line discounts" wx:if="{{orderInfo.subOrderCoupon.denomination}}">
优惠:
<view class="selected">已选一张</view>
<view class="price"><text class="unit">¥</text>{{(orderInfo.subOrderCoupon.discountAmount)/100}}</view>
</view>
<view class="price-item">
订单金额:
<view class="price sum"><text class="unit">¥</text>{{orderInfo.payPrice}}</view>
</view>
</view>
<!-- deliveryType 结算方式(1:到店核销,2:快递发货) -->
<block wx:if="{{orderInfo.deliveryType == 1 && qr && !orderInfo.relatedUserCoupon}}">
<view class="box">
<view class="title">核销码</view>
<view class="qr-box">
<view class="qr">
<image webp src="{{qr}}"></image>
</view>
<view class="code">{{orderInfo.orderVerification.verificationCode}}</view>
<view class="tips">请将核销码拿给店员,避免泄露给他人</view>
</view>
</view>
</block>
<view class="box" wx:if="{{orderInfo.relatedUserCoupon}}">
<view class="title">关联优惠券</view>
<block wx:for="{{couponsList}}" wx:key="index">
<view class="box_wrapper">
<glsx-image webp src="mine/coupon/{{item.usedAmount == 0?'':'un-'}}coupon-{{item.discountType}}.png" class="bg"></glsx-image>
<view class="info flex">
<view class="{{item.discountType==4 || item.discountType==7 ? '':'left_icon_box'}}">
<view wx:if="{{item.discountType==3}}" class="left_text_one left_text_two {{item.usedAmount == 0 ? 'brightColor':'darkColor'}}">
<text class="price_icon">¥</text>
<text>{{item.denomination}}</text>
</view>
<view wx:if="{{item.discountType==2}}" class="left_text_one left_text_two {{item.usedAmount == 0 ? 'brightColor':'darkColor'}}">
<text class="anText">{{item.discountIntensity / 100}}</text>
<text class="discount">折</text>
</view>
</view>
<view class="main_box {{item.discountType==4 || item.discountType==7 ? 'leftMargin':''}}">
<view class="title_text {{item.usedAmount == 0 ? 'brightColor':'darkColor'}}">{{item.couponName}}</view>
<view wx:if="{{item.useType==0 && coupons.discountType==7}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">不限次数</view>
<view wx:if="{{item.useType==1 && coupons.discountType==7}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">可用{{item.useAmount}}次</view>
<view wx:if="{{item.useType==2 && coupons.discountType==7}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">{{item.useLimitDays}}天可用{{item.useAmount}}次</view>
<view wx:if="{{item.useBarriers==1 && item.discountType!=4}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">无门槛</view>
<view wx:if="{{item.useBarriers==2 && item.discountType!=4}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">满{{item.full}}元可用</view>
<view wx:if="{{item.effectiveType==3}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">永久有效</view>
<view wx:if="{{item.effectiveType==2}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">{{item.receiveStartTime}}-{{item.receiveEndTime}}</view>
<view wx:if="{{item.effectiveType==1}}" class="h4_text {{item.usedAmount == 0 ? 'describeColor':'darkColor'}}">有效至{{item.receiveEndTime}}</view>
</view>
<block wx:if="{{!hideBtn}}">
<view wx:if="{{item.usedAmount==0}}" class="box_btn box_btn_color" bind:tap="toDetail">去使用</view>
<view wx:if="{{item.usedAmount==1}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
<view wx:if="{{item.usedAmount==2}}" class="box_btn box_btn_color box_btn_color_grey" bind:tap="toDetail">去查看</view>
</block>
</view>
</view>
</block>
</view>
</view> </view>
</block> </block>
\ No newline at end of file \ No newline at end of file
// 整合所有组件的mock数据,用于页面整体调试
const { mockDeliveryInfoData } = require('./components/DeliveryInfo/mock.js');
const { mockOrderInfoData } = require('./components/OrderInfo/mock.js');
const { mockOrderGoodsData } = require('./components/OrderGoods/mock.js');
const { mockOrderAmountData } = require('./components/OrderAmount/mock.js');
const mockOrderDetailData = {
orderInfo: {
...mockDeliveryInfoData.orderInfo,
...mockOrderInfoData.orderInfo,
...mockOrderGoodsData.orderInfo,
...mockOrderAmountData.orderInfo,
merchantName: '官方旗舰店',
orderSource: 1
},
orderObj: mockOrderInfoData.orderObj,
statusEnum: mockOrderInfoData.statusEnum,
deliveryStatus: mockDeliveryInfoData.deliveryStatus
};
module.exports = {
mockOrderDetailData
};
\ No newline at end of file \ No newline at end of file
.content-top { .text-hide {
/* 样式将在使用时通过类名动态添加 */ overflow: hidden;
} text-overflow: ellipsis;
white-space: nowrap;
.content-bottom {
/* 样式将在使用时通过类名动态添加 */
} }
.goods { .goods {
...@@ -69,6 +67,7 @@ ...@@ -69,6 +67,7 @@
.info-top .number { .info-top .number {
color: #656566; color: #656566;
font-size: 24rpx; font-size: 24rpx;
display: flex;
} }
.info-bottom { .info-bottom {
......
// components/Goods/Goods.js
import { centsToyuan } from '~/utils/format'
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
observer(n, o) {
if (n) {
if (n.activityInfo) {
n.originalPrice = ''
n.retailPrice = n.activityInfo.activityPrice
n.goodsStatistics.saleAmount = n.activityInfo.saleAmount
if (n.activityInfo.specificationExtraList && n.activityInfo.specificationExtraList.length) {
n.retailPrice = n.activityInfo.specificationExtraList[0].retailPrice
n.up = true
}
} else {
if (n.originalPrice) n.originalPrice = centsToyuan(n.originalPrice)
if (n.specificationDetailList && n.specificationDetailList.length) {
n.retailPrice = n.specificationDetailList[0].retailPrice
n.up = true
}
}
n.retailPrice = Number(centsToyuan(n.retailPrice)).toFixed(2)
if (n.retailPrice > 9999) {
n.retailPrice = Number(n.retailPrice / 10000).toFixed(2)
n.unit = '万'
}
this.setData({ item: n })
}
}
},
indexStyle: Boolean
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
setWidth() {
wx.p.wxApi.getViewInfo(
'.Goods',
res => {
this.setData({
previewHeight: res.width * 2
})
},
this
)
},
jump(e) {
let { item } = e.currentTarget.dataset
let { id, activityInfo } = item
let isActivity = false
if (activityInfo) {
id = activityInfo.id
isActivity = true
}
wx.p.router.go('/packageMall/pages/detail/detail', { id, isActivity, notIntercept: true })
}
},
lifetimes: {
attached() {
this.setWidth()
}
}
})
<view class="Goods" bindtap="jump" data-item="{{item}}">
<view class="preview" style="height:{{previewHeight}}rpx">
<glsx-image webp src="{{item.goodsImage}}" lazy-load></glsx-image>
</view>
<view class="name text-hide">{{item.goodsName}}</view>
<view class="info ">
<view class="icon">
<glsx-image webp src="mall/eye.png"></glsx-image>
</view>
<view class="text text-hide">{{item.goodsStatistics.viewAmount||0}}|售出{{item.goodsStatistics.saleAmount || 0}}
</view>
</view>
<view class="price">
<view class="now {{indexStyle}}">
<text class="unit">¥</text>{{item.retailPrice || 0}}
<text class="unit up" wx:if="{{item.unit}}">{{item.unit}}</text>
<text class="unit up" wx:if="{{item.up}}">起</text>
</view>
<block wx:if="{{item.originalPrice >= 0 && item.originalPrice}}">
<view class="old">
¥{{item.originalPrice || 0}}
</view>
</block>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/Goods/Goods.wxss */
.Goods{
width: 100%;
border-radius: 8rpx;
}
.Goods .preview {
border-radius: 8rpx;
overflow: hidden;
height: 252rpx;
}
.Goods .name {
color: #2D2D2E;
margin: 16rpx 0 ;
}
.Goods .info {
color: #B1B1B3;
font-size: 20rpx;
display: flex;
align-items: center;
}
.Goods .info .icon {
width: 24rpx;
height: 24rpx;
margin-right: 2rpx;
}
.Goods .info .icon .text{
width: calc(100% - 26rpx);
}
.Goods .price {
display: flex;
align-items: center;
margin-top: 14rpx;
font-size: 20rpx;
}
.Goods .price .now {
display: flex;
align-items: baseline;
color: var(--btnColor);
font-size: 34rpx;
line-height: 34rpx;
font-weight: 500;
letter-spacing: -0.5rpx;
}
.Goods .price .now.true{
font-size: 40rpx;
line-height: 40rpx;
}
.Goods .price .now .unit {
font-size: 20rpx;
margin: 0 4rpx;
}
.Goods .price .now.true .unit{
font-size: 24rpx;
}
.Goods .price .now .up{
transform: translateY(-2rpx);
}
.Goods .price .old {
color: #C9CACC;
text-decoration: line-through;
margin-left: auto;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
// components/tabView/tabView.js
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/**
* 组件的属性列表
*/
properties: {
tabList: {
type: Array,
value: []
},
height: null,
tagIndex: {
type: Number,
value: 0
},
refresherEnabled: Boolean,
triggered: Boolean
},
/**
* 组件的初始数据
*/
data: {
scrollTop: 0,
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
let {
index,
item
} = e.currentTarget.dataset
item.index = index
this.setData({
scrollTop: 0,
tagIndex: index
})
this.triggerEvent('click', item)
},
tabScrollTolower(e) {
this.triggerEvent('tabScrollTolower')
},
viewScrollTolower(e) {
this.triggerEvent('viewScrollTolower')
},
bindrefresherrefresh(e) {
this.triggerEvent('refresherrefresh')
}
}
})
\ No newline at end of file \ No newline at end of file
<view class="tab-box" id="tabView" style="height:calc(100vh - {{height}}px)">
<scroll-view style="height:100%;" scroll-y class="tab" bindscrolltolower="tabScrollTolower">
<view>
<block wx:for="{{tabList}}" wx:key="index">
<view class="tab-item {{tagIndex==index?'active':''}}" bindtap="click" data-item="{{item}}" data-index="{{index}}">
{{item.zoneName}}</view>
</block>
</view>
</scroll-view>
<view class="view">
<view style="height:100%;">
<scroll-view style="height:100%" scroll-y scroll-top="{{scrollTop}}" bindscrolltolower="viewScrollTolower"
refresher-enabled="{{refresherEnabled}}" refresher-triggered="{{triggered}}"
bindrefresherrefresh="bindrefresherrefresh">
<view class="content">
<slot name="content"></slot>
</view>
</scroll-view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/tabView/tabView.wxss */
.tab-box {
display: flex;
}
.tab {
width: 21.33%;
box-sizing: border-box;
text-align: center;
background: #F9F7F7;
}
.tab ::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
color: transparent;
}
.view {
width: 78.67%;
height: 100%;
position: relative;
background: #F9F7F7;
}
.tab-item {
width: 100%;
height: 120rpx;
line-height: 120rpx;
font-size: 26rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #666666;
box-sizing: border-box;
padding: 0 10rpx;
transition: all .5s;
background: #F2EFEF;
}
.active {
font-weight: 500;
background: #fff;
position: sticky;
top: 0;
color: #000;
}
.active::after {
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8rpx;
background-color: var(--btnColor);
content: '';
animation: show-border .5s forwards;
}
@keyframes show-border {
0% {
height: 0;
}
100% {
height: 60rpx;
}
}
.refresherEnabled {
position: relative;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
opacity: 0;
}
.content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
\ No newline at end of file \ No newline at end of file
// pages/tab/mall/index.js
const defaultClassify = ['今日推荐', '新酒预售', '口粮特选', '店铺爆款', '寰球名庄', '红葡萄酒', '白葡萄酒', '雷司令', '起泡酒', '果汁', '西班牙', '南非', '意大利', '德国']
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tagIndex: 0, goodsList: [{
tabList: [],
goodsList: [] }],
}, chooseIndex: null,
pageNum: 1, shoppingcartFlag: true
total: 0,
async search(e) {
let value = e.detail
let {
goodsList,
tagIndex
} = this.data
if (tagIndex == 0) {
if (this.goodsStorageList) this.jumpSearch(this.goodsStorageList, value)
else if (goodsList.length < this.total) {
this.getGoodsList(res => {
this.goodsStorageList = res
this.jumpSearch(res, value)
})
} else this.jumpSearch(goodsList, value)
} else this.jumpSearch(goodsList, value)
},
jumpSearch(goodsList, value) {
wx.p.router.go('/packageMall/pages/search/search', {
value,
goodsList,
notIntercept: true
})
this.setData({
searchVal: ''
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getMerchantClassify()
this.getGoodsList()
}, },
async getMerchantClassify() { goodsActionReady(e) {
wx.p.wxApi.showLoading('加载中...')
try {
const {
merchantId
} = wx.p.storage.get('merchant_info'),
res = await wx.p.api.shopmallApi.getMerchantClassify({
merchantId
})
let tabList = [{
zoneName: '全部',
id: '',
zoneImg: `mall/default-banner.png`
}]
res.list.map(e => {
let tab = {
zoneName: e.classifyName,
id: e.id,
zoneImg: `mall/${e.classifyName}.png`
}
if (!defaultClassify.includes(e.classifyName)) tab.zoneImg = `mall/default-banner.png`
tabList.push(tab)
})
this.setData({ this.setData({
tabList, padding_bottom: e.detail
flag: true
}) })
wx.hideLoading()
} catch (error) {
wx.p.wxApi.showToast(error)
}
}, },
getGoodsList(callBack) { changeCount(e) {
wx.hideLoading() console.log(e)
const { let count = e.detail
tagIndex
} = this.data
if (tagIndex != 0) return
wx.p.wxApi.showLoading('加载中...')
let params = {
pageSize: callBack ? 99999 : 10,
pageNum: callBack ? 1 : this.pageNum
}
wx.p.api.shopmallApi.getGoodsList(params).then(({
list,
total
}) => {
if (callBack) callBack(list)
else {
let { let {
goodsList index,
item,
ind
} = e.currentTarget.dataset
if (item.goodsNumber == count) return
let {
chooseIndex
} = this.data } = this.data
this.setData({ this.setData({
goodsList: goodsList.concat(list), [`goodsList[${index}].list[${ind}].goodsNumber`]: count
goodsFlag: true
}) })
this.total = total if (chooseIndex == index) this.cheackAll(index)
wx.p.wxApi.showLoading('正在加载...')
let params = {
id: item.id,
goodsId: item.goodsId,
goodsNumber: count
} }
if (item.specificationKey) params.specificationKey = item.specificationKey
wx.p.api.shopmallApi.updateShoppingcart(params).then(res => {
wx.hideLoading() wx.hideLoading()
}) })
}, },
/** choose(e) {
* 生命周期函数--监听页面初次渲染完成 let {
*/ index,
onReady() { ind
} = e.currentTarget.dataset
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
let { let {
tabList, goodsList,
tagIndex chooseIndex
} = this.data } = this.data
if (tabList.length == 0) return if (chooseIndex != null && chooseIndex != index) return
this.changeData(tagIndex) if (goodsList[index].list[ind].showDel) {
}, this.hide(e)
changeData(index) { return
}
this.setData({ this.setData({
tagIndex: index, [`goodsList[${index}].list[${ind}].active`]: !goodsList[index].list[ind].active
goodsList: [], })
goodsFlag: false, this.cheackAll(index)
nothing: false
})
this.pageNum = 1
const {
tabList
} = this.data
if (tabList[index].id) this.getMerchantClassifyGoods(tabList[index].id)
else this.getGoodsList()
}, },
async getMerchantClassifyGoods(id) { cheackAll(index) {
wx.p.wxApi.showLoading('加载中...') let count = 0
let sum = 0
let {
goodsList
} = this.data
let allActive = true
try { try {
const { goodsList[index].list.map(e => {
merchantId if (!e.active) throw false
} = wx.p.storage.get('merchant_info'), {
goodsRefList
} = await wx.p.api.shopmallApi.getMerchantClassifyGoods({
id,
merchantId
})
let goodsList = []
if (goodsRefList && goodsRefList.length) {
goodsRefList.map(e => {
e.goods.goodsStatistics = e.goodsStatistics
goodsList.push(e.goods)
}) })
} catch (error) {
allActive = error
}
goodsList[index].list.map(e => {
if (e.active) {
count += e.goodsNumber
sum += e.retailPrice * e.goodsNumber
} }
})
this.setData({ this.setData({
goodsList, [`goodsList[${index}].active`]: allActive,
goodsFlag: true count,
sum: sum == 0 ? 0 : Number(sum).toFixed(2),
chooseIndex: count == 0 ? null : index
}) })
wx.hideLoading()
} catch (error) {
}
},
goShoppingCart() {
wx.p.router.go('/packageMall/pages/shoppingCart/shoppingCart')
}, },
tabclick(e) { chooseAll(e) {
let { let {
index index
} = e.detail } = e.currentTarget.dataset
let { let {
tagIndex goodsList,
chooseIndex
} = this.data } = this.data
if (index == tagIndex) return if (chooseIndex != null && chooseIndex != index) return
this.changeData(index) let all = true
this.goodsStorageList = null try {
goodsList[index].list.map(i => {
if (!i.active) throw false
})
} catch (error) {
goodsList[index].list.map(i => (i.active = true))
all = error
}
if (all) goodsList[index].list.map(i => (i.active = false))
this.setData({
goodsList
})
this.cheackAll(index)
}, },
viewScrollTolower() { checkOut() {
const { let {
tagIndex chooseIndex,
goodsList
} = this.data } = this.data
if (tagIndex == 0) {
let { let {
pageNum, list,
total payeeMerchantName,
} = this } = goodsList[chooseIndex]
wx.p.util.onReachBottom({ let data = []
pageNum, list.map(e => (e.active ? data.push(e) : ''))
total, wx.p.router.go('/packageMall/pages/pay/pay', {
_this: this goodsList: data,
}, () => { merchantName: payeeMerchantName
this.pageNum++
this.getGoodsList()
}) })
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.getShoppingcartList()
},
getShoppingcartList() {
wx.p.wxApi.showLoading('加载中...')
let para = {
cartType: 1
} }
wx.p.api.shopmallApi
.getShoppingcartList(para)
.then(data => {
data.map(e => {
e.list.map(i => (i.retailPrice = Number(i.retailPrice).toFixed(2)))
})
this.setData({
goodsList: data,
shoppingcartFlag: true,
count: 0,
sum: 0,
chooseIndex: null
})
wx.hideLoading()
})
.catch(() => {
this.setData({
shoppingcartFlag: true
})
})
}, },
onTabItemTap(e) { del(e) {
this.goodsStorageList = null wx.p.wxApi.showLoading('请稍后...')
let {
id
} = e.target.dataset
let para = {
cartType: 1,
id
}
wx.p.api.shopmallApi.delShoppingcart(para).then(res => {
wx.p.wxApi.showToast('删除成功')
setTimeout(() => {
this.getShoppingcartList()
}, 1.5 * 1000)
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide: function () {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() {}, onUnload: function () {},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh: function () {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom: function () {},
hide(e) {
let {
goodsList
} = this.data
let {
index,
ind
} = e.currentTarget.dataset
if (goodsList[index].list[ind].showDel)
this.setData({
[`goodsList[${index}].list[${ind}].showDel`]: false
})
}, },
start(e) {
/** let cell = e.changedTouches[0]
* 用户点击右上角分享 this.startX = cell.clientX
*/ this.startY = cell.clientY
onShareAppMessage() { },
move(e) {
let {
startX,
startY
} = this
let {
index,
ind
} = e.currentTarget.dataset
let {
clientX,
clientY
} = e.changedTouches[0]
let X = clientX - startX
let Y = clientY - startY
let angle = (360 * Math.atan(Y / X)) / (2 * Math.PI)
let result = clientX < startX
if (Math.abs(angle) > 30) return
this.setData({
[`goodsList[${index}].list[${ind}].showDel`]: result
})
} }
}) })
\ No newline at end of file \ No newline at end of file
{ {
"navigationBarTitleText": "购物车",
"usingComponents": { "usingComponents": {
"search-box":"./components/SearchBox/SearchBox", "stepper": "/components/Stepper/Stepper"
"tab-view":"./components/TabView/TabView", }
"goods":"./components/Goods/Goods"
},
"navigationBarTitleText": "商城",
"navigationStyle": "custom"
} }
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/pages/mall/mall.wxss */ page {
/* pages/tab/mall/mall.wxss */ background: #F7F8FA;
.mall-layout{ }
.nothing-box {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: #F7F8FA;
}
.nothing {
padding-top: 140rpx;
text-align: center;
color: #7A8299;
}
.nothing .icon {
margin: 0 auto 32rpx;
width: 320rpx;
height: 300rpx;
}
.box {
padding: 24rpx var(--margin);
}
.item-box {
margin-bottom: 24rpx;
background: #FFFFFF;
border-radius: 8rpx;
padding-left: 24rpx;
}
.item-box.disabled {
opacity: .5;
}
.item-box .top {
height: 80rpx;
display: flex;
align-items: center;
padding-right: 24rpx;
}
.item-box .top .icon {
margin-right: 18rpx;
}
.item-box .top .name {
width: calc(100% - 50rpx);
}
.item-box .list {
border-top: 2rpx solid #EFF0F2;
}
.box .item {
width: 100%;
height: 208rpx;
background: #FFFFFF;
border-radius: 8rpx;
margin-bottom: 24rpx;
overflow: hidden;
display: flex;
justify-content: space-between;
position: relative; position: relative;
} }
.tab-view-box { .box .item .content {
padding: 16rpx var(--margin); width: 100%;
padding-right: 24rpx;
box-sizing: border-box;
transition: all .5s;
transform: translateX(112rpx);
margin-left: -112rpx;
position: relative;
display: flex;
align-items: center;
} }
.tab-view-box .box{ .box .item .content .icon,
animation: show-box-opacity .25s forwards; .box .item .content .goods-info .preview {
margin-right: 20rpx;
} }
.tab-view-box .banner { .box .item .content .goods-info {
height: 220rpx; width: calc(100% - 60rpx);
display: flex;
align-items: center;
}
.box .item .content .goods-info .preview {
width: 160rpx;
height: 160rpx;
border-radius: 8rpx; border-radius: 8rpx;
overflow: hidden; overflow: hidden;
} }
.box .item .content .goods-info .text {
.tab-view-box .title { width: calc(100% - 180rpx);
height: 160rpx;
display: flex; display: flex;
flex-direction: column;
justify-content: space-between; justify-content: space-between;
height: 80rpx;
align-items: center;
border-bottom: 2rpx solid #EFF0F2;
} }
.box .item .content .goods-info .text .price-box {
.tab-view-box .title .icon { display: flex;
width: 40rpx; align-items: baseline;
height: 40rpx; justify-content: space-between;
flex-shrink: 0;
} }
.box .item .content .goods-info .text .price-box .price {
.tab-view-box .goods-box { color: var(--btnColor);
padding: 18rpx 0; font-size: 36rpx;
display: flex;
align-items: baseline;
font-weight: 500;
}
.box .item .content .goods-info .text .price-box .price .unit {
font-size: 24rpx;
}
.box .item .del {
width: 112rpx;
height: 100%;
background: var(--themeColor);
transform: translateX(112rpx);
transition: all .5s;
color: #fff;
}
.box .touch-move-active .content,
.box .touch-move-active .del {
transform: translateX(0);
}
.goods-action {
padding: 10rpx var(--margin);
box-sizing: border-box;
height: 100rpx;
display: flex; display: flex;
flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
align-items: center;
} }
.tab-view-box .goods-box .item{ .goods-action .btn {
width: 252rpx; width: 332rpx;
margin-bottom: 18rpx; height: 80rpx;
color: #FFFFFF;
background: var(--btnColor);
border-radius: var(--borderRadius);
font-weight: 500;
padding: 0 !important;
margin: 0 !important;
font-size: 28rpx;
&[disabled]:not([type]) {
background: #CCCED1 !important;
border-color: #CCCED1 !important;
color: #fff !important;
box-shadow: none;
}
} }
.list-nothing{ .goods-action .total {
flex-direction: column; width: calc(100% - 360rpx);
font-size: 24rpx;
display: flex;
align-items: baseline;
}
.goods-action .total .price {
color: var(--btnColor);
font-size: 40rpx;
display: flex;
align-items: baseline;
font-weight: 500;
}
.goods-action .total .price .unit {
font-size: 24rpx;
}
.specification {
font-size: 24rpx;
color: #B1B1B3;
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!