【订单详情】

1. 梳理 html 和 data 属性,标记哪些是 TODO
pull/1/MERGE
YunaiV 2023-06-06 23:47:32 +08:00
parent 9fca18b350
commit c9f3f7f6ff
1 changed files with 106 additions and 90 deletions

View File

@ -12,7 +12,7 @@
</view>
</view>
</view>
<view id="home" class="home acea-row row-center-wrapper iconfont icon-xiangzuo" :class="opacity>0.5?'on':''"
<view id="home" class="home acea-row row-center-wrapper iconfont icon-xiangzuo" :class="opacity > 0.5?'on':''"
:style="{ top: homeTop + 'rpx' }" v-if="returnShow" @tap="returns">
</view>
<!-- <view class='iconfont icon-xiangzuo' :style="'top:'+navH/2+'rpx'" @tap='returns'></view> -->
@ -48,7 +48,7 @@
<view class='activity'>赠送 {{productInfo.give_integral}} 积分</view>
</view>
</view> -->
<!-- TODO 芋艿卡在这个位置 -->
<!-- 优惠劵 TODO 芋艿待接入 -->
<view v-if="coupon.list.length > 0 && type==='normal'"
class='coupon acea-row row-between-wrapper' @click='couponTap'>
<view class='hide line1 acea-row'>
@ -59,7 +59,8 @@
</view>
<view class='iconfont icon-jiantou'></view>
</view>
<view class="coupon acea-row row-between-wrapper" v-if="activityH5.length">
<!-- 营销活动 TODO 芋艿待接入 -->
<view class="coupon acea-row row-between-wrapper" v-if="activityH5.length">
<view class="line1 acea-row">
<text class="activityName">&nbsp;&nbsp;&nbsp;</text>
<view v-for='(item,index) in activityH5' :key='index' @click="goActivity(item)"
@ -85,12 +86,14 @@
</view>
</view>
</view>
<!-- SKU 选择 -->
<view class='attribute acea-row row-between-wrapper mb30 borRadius14' @click="openAttr">
<view class="line1">{{ attrValue.length > 0 ? "已选择" : "请选择" }}
<text class='atterTxt'>{{attrValue}}</text>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
<!-- 评论 TODO 芋艿待完成 -->
<view class='userEvaluation' id="past1">
<view class='title acea-row row-between-wrapper'
:style="replyCount==0?'border-bottom-left-radius:14rpx;border-bottom-right-radius:14rpx;':''">
@ -105,7 +108,7 @@
<userEvaluation :reply="reply"></userEvaluation>
</block>
</view>
<!-- 优品推荐 -->
<!-- 优品推荐 TODO 芋艿待完成 -->
<view class="superior borRadius14" if='good_list.length' id="past2">
<view class="title acea-row row-center-wrapper">
<image src="../../static/images/xzuo.png"></image>
@ -154,6 +157,7 @@
</scroll-view>
</view>
<view class='footer acea-row row-between-wrapper'>
<!-- 客服 TODO 芋艿待完成 -->
<!-- #ifdef MP -->
<button open-type="contact" hover-class='none' class='item'>
<view class='iconfont icon-kefu'></view>
@ -166,43 +170,56 @@
<view>客服</view>
</view>
<!-- #endif -->
<block v-if="type === 'normal'">
<view @click="setCollect" class='item'>
<!-- 场景普通订单 -->
<block v-if="type === 'normal'">
<!-- 收藏 TODO 芋艿收藏逻辑 -->
<view @click="setCollect" class='item'>
<view class='iconfont icon-shoucang1' v-if="userCollect"></view>
<view class='iconfont icon-shoucang' v-else></view>
<view>收藏</view>
</view>
<navigator open-type='switchTab' class="animated item" :class="animated==true?'bounceIn':''"
url='/pages/order_addcart/order_addcart' hover-class="none">
<navigator open-type='switchTab' class="animated item" :class="animated ? 'bounceIn':''"
url='/pages/order_addcart/order_addcart' hover-class="none">
<view class='iconfont icon-gouwuche1'>
<text v-if="Math.floor(CartCount)>0" class='num bg-color'>{{CartCount}}</text>
<text v-if="CartCount > 0" class='num bg-color'>{{CartCount}}</text>
</view>
<view>购物车</view>
</navigator>
<!-- 无库存不允许购买 -->
<view class="bnt acea-row" v-if="attr.productSelect.stock <= 0">
<form @submit="joinCart" report-submit="true"><button class="joinCart bnts"
form-type="submit">加入购物车</button></form>
<form report-submit="true"><button class="buy bnts bg-color-hui" form-type="submit">已售罄</button>
<form @submit="joinCart" report-submit="true">
<button class="joinCart bnts" form-type="submit">加入购物车</button>
</form>
<form report-submit="true">
<button class="buy bnts bg-color-hui" form-type="submit">已售罄</button>
</form>
</view>
<view class="bnt acea-row" v-else>
<form @submit="joinCart" report-submit="true"><button class="joinCart bnts"
form-type="submit">加入购物车</button></form>
<form @submit="goBuy" report-submit="true"><button class="buy bnts" form-type="submit">立即购买</button>
<!-- 有库存允许购买 -->
<view class="bnt acea-row" v-else>
<form @submit="joinCart" report-submit="true">
<button class="joinCart bnts" form-type="submit">加入购物车</button>
</form>
<form @submit="goBuy" report-submit="true">
<button class="buy bnts" form-type="submit">立即购买</button>
</form>
</view>
</block>
<view class="bnt bntVideo acea-row" v-if="attr.productSelect.stock <= 0 && type === 'video'">
<form report-submit="true"><button class="buy bnts bg-color-hui" form-type="submit">已售罄</button></form>
</view>
<view class="bnt bntVideo acea-row" v-if="attr.productSelect.stock > 0 && type === 'video'">
<form @submit="goBuy" report-submit="true"><button class="buy bnts" form-type="submit">立即购买</button>
</form>
</view>
<!-- 场景视频订单 -->
<block v-else-if="type === 'video'">
<!-- 无库存不允许购买 -->
<view class="bnt bntVideo acea-row" v-if="attr.productSelect.stock <= 0 && type === 'video'">
<form report-submit="true"><button class="buy bnts bg-color-hui" form-type="submit">已售罄</button></form>
</view>
<!-- 有库存允许购买 -->
<view class="bnt bntVideo acea-row" v-if="attr.productSelect.stock > 0 && type === 'video'">
<form @submit="goBuy" report-submit="true"><button class="buy bnts" form-type="submit">立即购买</button>
</form>
</view>
</block>
</view>
<shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet"
@closeChange="closeChange"></shareRedPackets>
<!-- 组件 -->
<!-- SKU 弹窗 -->
<productWindow
:attr="attr"
:isShow='1'
@ -210,14 +227,13 @@
@myevent="onMyEvent"
@ChangeAttr="ChangeAttr"
@ChangeCartNum="ChangeCartNum"
@attrVal="attrVal"
@iptCartNum="iptCartNum"
id='product-window'
/>
<home></home>
<!-- 优惠劵弹窗 TODO 芋艿待实现 -->
<couponListWindow :coupon='coupon' @ChangCouponsClone="ChangCouponsClone" @ChangCoupons="ChangCoupons"
@ChangCouponsUseState="ChangCouponsUseState" @tabCouponType="tabCouponType"></couponListWindow>
<!-- 分享按钮 -->
<!-- 分享按钮 TODO 芋艿待实现 -->
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<!-- #ifndef MP -->
<button class="item" hover-class='none' v-if="weixinStatus === true" @click="H5ShareBox = true">
@ -236,12 +252,13 @@
<view class="">生成海报</view>
</button>
</view>
<!-- TODO 芋艿不知道啥东西 -->
<view class="mask" v-if="posters" @click="closePosters"></view>
<view class="mask" v-if="canvasStatus"></view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<!-- 海报展示 -->
<!-- 海报展示 TODO 芋艿待实现 -->
<view class='poster-pop' v-if="canvasStatus">
<image src='../../static/images/poster-close.png' class='close' @click="posterImageClose"></image>
<image :src='imagePath'></image>
@ -308,7 +325,6 @@
import {
getQrcode
} from '@/api/api.js';
import {convertProductPropertyList, convertProductSkuMap} from "../../utils/product";
// #endif
let app = getApp();
export default {
@ -326,81 +342,80 @@
},
data() {
return {
//
// TODO
coupon: {
coupon: false,
type: 1,
list: [],
count: []
},
animated: false, //
id: 0, //id
replyCount: 0, //
reply: [], //
productInfo: {}, // TODO
id: 0, // id
productInfo: {}, // TODO
spu: {}, // SPU
skuMap: [], // SKU Map
couponList: [], //
cart_num: 1, //
isAuto: false, //
isShowAuth: false, //
isOpen: false, //
actionSheetHidden: true,
storeImage: '', //
PromotionCode: '', //
posterbackgd: '/static/images/posterbackgd.png',
sharePacket: {
isState: true, //
}, //
// uid: 0, //uid
circular: false,
autoplay: false,
interval: 3000,
duration: 500,
clientHeight: "",
systemStore: {}, //
good_list: [],
replyChance: 0,
CartCount: 0,
isDown: true,
posters: false,
weixinStatus: false,
skuMap: [], // SKU Map
attrValue: '', // ,
attr: { // productWindow 使
cartAttr: false, //
cartAttr: false, //
// id = name = values[].id = values[].name = index =
properties: [],
properties: [],
productSelect: {} // SKU
},
CartCount: 0, //
animated: false, //
replyCount: 0, // TODO
reply: [], //
replyChance: 0, // TODO
userCollect: false,
couponList: [], // TODO
cart_num: 1, // TODO
isAuto: false, // TODO
isShowAuth: false, // TODO
isOpen: false, // TODO attr.cartAttr
actionSheetHidden: true, // TODO
storeImage: '', // // TODO
PromotionCode: '', // // TODO
posterbackgd: '/static/images/posterbackgd.png', // TODO
sharePacket: { //
isState: true, // // TODO
},
navActive: 0,
H5ShareBox: false, //
activityH5: [],
retunTop: true, //
navH: "",
navList: [],
opacity: 0,
scrollY: 0,
topArr: [],
toView: '',
height: 0,
heightArr: [],
lock: false,
scrollTop: 0,
tagStyle: {
circular: false, // TODO
autoplay: false, // TODO
interval: 3000, // TODO
duration: 500, // TODO
clientHeight: "", // TODO
systemStore: {}, // TODO
good_list: [], // TODO
isDown: true, // TODO
posters: false, // TODO
weixinStatus: false, // TODO
H5ShareBox: false, // TODO
activityH5: [], // TODO
retunTop: true, // TODO
navH: "", // nav
navList: [], // nav
navActive: 0, // nav
opacity: 0, // TODO
scrollY: 0, // TODO
topArr: [], // TODO
toView: '', // TODO
height: 0, // TODO
heightArr: [], // TODO
lock: false, // TODO
scrollTop: 0, // TODO
tagStyle: { //
img: 'width:100%;display:block;',
table: 'width:100%',
video: 'width:100%'
},
qrcodeSize: 600,
canvasStatus: false, //
imagePath: '', //
imgTop: '',
errT: '',
homeTop: 20,
navbarRight: 0,
userCollect: false,
returnShow: true, //
type: "" //
qrcodeSize: 600, // TODO
canvasStatus: false, // TODO
imagePath: '', // TODO
imgTop: '', // TODO
errT: '', // TODO
homeTop: 20, // TODO
navbarRight: 0, // TODO
returnShow: true, // // TODO
type: "" // TODO
};
},
computed: mapGetters(['isLogin', 'uid', 'chatUrl']),
@ -1020,7 +1035,8 @@
},
/**
* 获取购物车数量
* @param boolean 是否展示购物车动画和重置属性
*
* @param isAnima 是否展示购物车动画和重置属性
*/
getCartCount: function(isAnima) {
let that = this;
@ -1028,7 +1044,7 @@
if (isLogin) {
getCartCounts(true, 'total').then(res => {
that.CartCount = res.data.count;
//
//
if (isAnima) {
that.animated = true;
setTimeout(function() {