tmp: 部分代码与UnishopV5结合,但是代码有严重缺陷

This commit is contained in:
2025-12-20 15:30:39 +08:00
parent ed5181b382
commit e263a616f6
183 changed files with 31316 additions and 18590 deletions

View File

@@ -14,13 +14,13 @@
<view class="dite-button" @click="officialAccountsOpen">关注公众号</view>
</view>
<!-- <view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch" :style="{ backgroundImage: bgImg }">
<view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch" :style="{ backgroundImage: bgImg }">
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="false"/>
</view> -->
</view>
<diy-index-page v-if="topIndexValue" ref="indexPage" :value="topIndexValue" :bgUrl="bgUrl" :scrollTop="scrollTop" :diyGlobal="diyData.global" class="diy-index-page">
<template v-slot:components>
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop" :haveTopCategory="true" :followOfficialAccount="followOfficialAccount"/>
<diy-group ref="diyGroup" v-if="diyData.value" :refresh="refresh" :diyData="diyData" :scrollTop="scrollTop" :haveTopCategory="true" :followOfficialAccount="followOfficialAccount"/>
</template>
<template v-slot:default>
<ns-copyright v-show="isShowCopyRight"/>
@@ -94,26 +94,27 @@
<!-- 选择门店弹出框定位当前位置展示最近的一个门店 -->
<view @touchmove.prevent.stop class="choose-store">
<uni-popup ref="chooseStorePopup" type="center" :maskClick="false" class="choose-store">
<view class="choose-store-popup">
<view class="head-wrap" @click="closeChooseStorePopup">请确认门店</view>
<view class="choose-store-popup" v-if="currentStore">
<view class="head-wrap">请确认门店</view>
<view class="position-wrap">
<text class="iconfont icon-dizhi"></text>
<text class="address">{{ currentPosition }}</text>
<view class="reposition" @click="reposition" v-if="globalStoreConfig && globalStoreConfig.is_allow_change == 1">
<text class="address">{{ currentPosition || currentStore.show_address }}</text>
<view class="reposition" @click="reGetLocation" v-if="globalStoreConfig && globalStoreConfig.is_allow_change == 1">
<text class="iconfont icon-dingwei"></text>
<text>重新定位</text>
</view>
</view>
<view class="store-wrap" v-if="nearestStore">
<view class="store-wrap" v-if="currentStore">
<text class="tag">当前门店</text>
<view class="store-name">{{ nearestStore.store_name }}</view>
<view class="address">{{ nearestStore.show_address }}</view>
<view class="distance" v-if="nearestStore.distance">
<view class="store-name">{{ currentStore.store_name }}</view>
<view class="store-close-desc" v-if="currentStore.status == 0 && currentStore.close_desc">{{ currentStore.close_desc }}</view>
<view class="address">{{ currentStore.show_address }}</view>
<view class="distance" v-if="currentStore.distance">
<text class="iconfont icon-dizhi"></text>
<text>{{ nearestStore.distance > 1 ? nearestStore.distance + 'km' : nearestStore.distance * 1000 + 'm' }}</text>
<text>{{ currentStore.distance > 1 ? currentStore.distance + 'km' : currentStore.distance * 1000 + 'm' }}</text>
</view>
</view>
<button type="primary" @click="enterStore">确认进入</button>
<button type="primary" @click="closeChooseStorePopup">确认进入</button>
<view class="other-store" @click="chooseOtherStore" v-if="globalStoreConfig && globalStoreConfig.is_allow_change == 1">
<text>选择其他门店</text>
<text class="iconfont icon-right"></text>
@@ -121,12 +122,34 @@
</view>
</uni-popup>
</view>
<hover-nav></hover-nav>
<!-- 连锁门店未开启定位或定位失败弹框 -->
<view @touchmove.prevent.stop class="chain-stores">
<uni-popup ref="getLocationFailRef" type="bottom" :maskClick="false" class="choose-store">
<view class="chain-store-popup">
<view class="title">获取位置失败</view>
<view class="body">
<view class="center">
<view class="image">
<image width="341rpx" :src="$util.img('public/uniapp/index/no_location_tips.png')" mode="aspectFit"/>
</view>
<view class="text-top">系统暂时定位不到您的位置</view>
<view class="text-bottom" v-if="mapConfig.wap_is_open == 1">请确认定位服务已经打开或者您可手动选择附近的门店以便我们提供更精确的服务</view>
<view class="text-bottom" v-else>请手动选择附近的门店以便我们提供更精确的服务</view>
<view class="footer">
<button :type="mapConfig.wap_is_open == 1?'default':'primary'" @click="chooseStore">选择门店</button>
<button v-if="mapConfig.wap_is_open == 1" type="primary" class="btn-right" @click="openSetting">开启定位</button>
</view>
</view>
</view>
</view>
</uni-popup>
</view>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
<ns-login ref="login"></ns-login>
</view>
</template>
@@ -136,8 +159,8 @@
import nsNavbar from '@/components/ns-navbar/ns-navbar.vue';
import diyJs from '@/common/js/diy.js';
import indexJs from './public/js/index.js';
import toTop from '@/components/toTop/toTop.vue';
import scroll from '@/common/js/scroll-view.js';
import toTop from '@/components/toTop/toTop.vue';
import scroll from '@/common/js/scroll-view.js';
export default {
@@ -250,6 +273,14 @@
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
/deep/ .chain-stores .uni-popup__mask{
backdrop-filter: blur(10rpx);
}
/deep/ .chain-stores .uni-popup__wrapper.uni-custom.bottom .uni-popup__wrapper-box, .uni-popup__wrapper.uni-custom.top .uni-popup__wrapper-box{
max-height: 100vh !important;
}
/deep/ .mescroll-totop {
right: 24rpx!important;

View File

@@ -3,7 +3,8 @@ export default {
return {
minScrollTop: 100, // 设置回到顶端按钮显示要求,最小页面滚动距离
wechatQrcode: '', // 公众号二维码
diyRoute: '/pages/index/index'
diyRoute: '/pages/index/index',
refresh:false,
};
},
onLoad(option) {
@@ -41,6 +42,9 @@ export default {
if (this.unsubscribe) this.unsubscribe();
},
methods: {
changeCategoryNav(e){
if(e == 0) this.refresh = !this.refresh;
},
// 关注公众号
getFollowQrcode() {
if (!this.$util.isWeiXin()) return;

View File

@@ -1,127 +1,127 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view :style="{ backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
<view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch" :style="{ backgroundImage: bgImg }">
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="true"/>
</view>
<diy-index-page v-if="topIndexValue" ref="indexPage" :value="topIndexValue" :bgUrl="bgUrl" :scrollTop="scrollTop" :diyGlobal="diyData.global" class="diy-index-page">
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop" :haveTopCategory="true"/>
<ns-copyright v-show="isShowCopyRight"/>
</diy-index-page>
<view v-else class="bg-index" :style="{ backgroundImage: backgroundUrl, paddingTop: paddingTop, marginTop: marginTop }">
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop"/>
<ns-copyright v-show="isShowCopyRight"/>
<view class="foot">
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=0')">隐私协议</view>
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=1')">注册协议</view>
</view>
</view>
<template v-if="diyData.global && diyData.global.popWindow && diyData.global.popWindow.count != -1 && diyData.global.popWindow.imageUrl">
<view @touchmove.prevent.stop>
<uni-popup ref="uniPopupWindow" type="center" class="wap-floating" :maskClick="false">
<view class="image-wrap">
<image :src="$util.img(diyData.global.popWindow.imageUrl)" :style="popWindowStyle" @click="uniPopupWindowFn()" mode="aspectFit"/>
</view>
<text class="iconfont icon-round-close" @click="closePopupWindow"></text>
</uni-popup>
</view>
</template>
<!-- 底部tabBar -->
<view id="tab-bar" :class="{ hide: bottomNavHidden }" v-if="openBottomNav">
<diy-bottom-nav @callback="callback"/>
</view>
<!-- 收藏 -->
<uni-popup ref="collectPopupWindow" type="top" class="wap-floating wap-floating-collect">
<view v-if="showTip" class="collectPopupWindow" :style="{ marginTop: (collectTop + statusBarHeight) * 2 + 'rpx' }">
<image :src="$util.img('public/uniapp/index/collect2.png')" mode="aspectFit"/>
<text @click="closeCollectPopupWindow">我知道了</text>
</view>
</uni-popup>
<ns-birthday-gift ref="birthdayGift"></ns-birthday-gift>
<ns-new-gift ref="nsNewGift"></ns-new-gift>
<hover-nav></hover-nav>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
</view>
</template>
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue';
import nsNavbar from '@/components/ns-navbar/ns-navbar.vue';
import diyJs from '@/common/js/diy.js';
import indexJs from './public/js/index.js';
export default {
components: {
uniPopup,
nsNavbar
},
mixins: [diyJs, indexJs],
methods:{
tourl(url){
this.$util.redirectTo(url);
}
}
};
</script>
<style lang="scss">
@import '@/common/css/diy.scss';
.foot{
display: flex;
// position: absolute;
width: 100%;
margin-bottom: 40rpx;
.item{
width: 50%;
text-align: center;
color:#F4391c
}
}
</style>
<style scoped>
.wap-floating>>>.uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none !important;
}
/deep/.diy-index-page .uni-popup .uni-popup__wrapper-box {
border-radius: 0;
}
.choose-store>>>.goodslist-uni-popup-box {
width: 80%;
}
/deep/ .placeholder {
height: 0;
}
/deep/::-webkit-scrollbar {
width: 0;
height: 0;
background-color: transparent;
display: none;
}
.hide {
display: none;
}
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
<template>
<page-meta :page-style="themeColor"></page-meta>
<view :style="{ backgroundColor: bgColor, minHeight: openBottomNav ? 'calc(100vh - 55px)' : '' }" class="page-img">
<view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch" :style="{ backgroundImage: bgImg }">
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="false"/>
</view>
<diy-index-page v-if="topIndexValue" ref="indexPage" :value="topIndexValue" :bgUrl="bgUrl" :scrollTop="scrollTop" :diyGlobal="diyData.global" class="diy-index-page">
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop" :haveTopCategory="true"/>
<ns-copyright v-show="isShowCopyRight"/>
</diy-index-page>
<view v-else class="bg-index" :style="{ backgroundImage: backgroundUrl, paddingTop: paddingTop, marginTop: marginTop }">
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop"/>
<ns-copyright v-show="isShowCopyRight"/>
<view class="foot">
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=0')">隐私协议</view>
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=1')">注册协议</view>
</view>
</view>
<template v-if="diyData.global && diyData.global.popWindow && diyData.global.popWindow.count != -1 && diyData.global.popWindow.imageUrl">
<view @touchmove.prevent.stop>
<uni-popup ref="uniPopupWindow" type="center" class="wap-floating" :maskClick="false">
<view class="image-wrap">
<image :src="$util.img(diyData.global.popWindow.imageUrl)" :style="popWindowStyle" @click="uniPopupWindowFn()" mode="aspectFit"/>
</view>
<text class="iconfont icon-round-close" @click="closePopupWindow"></text>
</uni-popup>
</view>
</template>
<!-- 底部tabBar -->
<view id="tab-bar" :class="{ hide: bottomNavHidden }" v-if="openBottomNav">
<diy-bottom-nav @callback="callback"/>
</view>
<!-- 收藏 -->
<uni-popup ref="collectPopupWindow" type="top" class="wap-floating wap-floating-collect">
<view v-if="showTip" class="collectPopupWindow" :style="{ marginTop: (collectTop + statusBarHeight) * 2 + 'rpx' }">
<image :src="$util.img('public/uniapp/index/collect2.png')" mode="aspectFit"/>
<text @click="closeCollectPopupWindow">我知道了</text>
</view>
</uni-popup>
<ns-birthday-gift ref="birthdayGift"></ns-birthday-gift>
<ns-new-gift ref="nsNewGift"></ns-new-gift>
<hover-nav></hover-nav>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
</view>
</template>
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue';
import nsNavbar from '@/components/ns-navbar/ns-navbar.vue';
import diyJs from '@/common/js/diy.js';
import indexJs from './public/js/index.js';
export default {
components: {
uniPopup,
nsNavbar
},
mixins: [diyJs, indexJs],
methods:{
tourl(url){
this.$util.redirectTo(url);
}
}
};
</script>
<style lang="scss">
@import '@/common/css/diy.scss';
.foot{
display: flex;
// position: absolute;
width: 100%;
margin-bottom: 40rpx;
.item{
width: 50%;
text-align: center;
color:#F4391c
}
}
</style>
<style scoped>
.wap-floating>>>.uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none !important;
}
/deep/.diy-index-page .uni-popup .uni-popup__wrapper-box {
border-radius: 0;
}
.choose-store>>>.goodslist-uni-popup-box {
width: 80%;
}
/deep/ .placeholder {
height: 0;
}
/deep/::-webkit-scrollbar {
width: 0;
height: 0;
background-color: transparent;
display: none;
}
.hide {
display: none;
}
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
</style>

View File

@@ -1,95 +1,97 @@
export default {
data() {
return {
diyRoute: '/pages/member/index'
};
},
computed: {},
watch: {
storeToken: function(nVal, oVal) {
if (nVal) {
this.initData();
if (uni.getStorageSync('source_member')) this.$util.onSourceMember(uni.getStorageSync(
'source_member'));
}
}
},
onLoad(data) {
//刷新多语言
this.$langConfig.refresh();
uni.hideTabBar();
this.name = 'DIY_VIEW_MEMBER_INDEX';
if (data.code) {
this.$api.sendRequest({
url: '/wechat/api/wechat/authcodetoopenid',
data: {
code: data.code
},
success: res => {
if (res.code >= 0) {
if (res.data.userinfo.nickName) this.modifyNickname(res.data.userinfo.nickName);
if (res.data.userinfo.avatarUrl) this.modifyHeadimg(res.data.userinfo
.avatarUrl);
}
}
});
}
},
onShow() {
// 刷新会员数据
if (this.$refs.diyGroup) {
if (this.$refs.diyGroup.$refs.diyMemberIndex) this.$refs.diyGroup.$refs.diyMemberIndex[0].init();
if (this.$refs.diyGroup.$refs.diyMemberMyOrder) this.$refs.diyGroup.$refs.diyMemberMyOrder[0].getOrderNum();
}
},
methods: {
/**
* 查询会员信息
*/
initData() {
if (this.storeToken) {
this.$nextTick(() => {
this.$refs.nsNewGift.init();
this.$refs.birthdayGift.init();
});
}
},
/**
* 修改昵称
* @param {Object} nickName
*/
modifyNickname(nickName) {
this.$api.sendRequest({
url: '/api/member/modifynickname',
data: {
nickname: nickName
},
success: res => {
if (res.code == 0) {
this.memberInfo.nickname = nickName;
this.$store.commit('setMemberInfo', this.memberInfo);
}
}
});
},
/**
* 修改头像
*/
modifyHeadimg(headimg) {
this.$api.sendRequest({
url: '/api/member/modifyheadimg',
data: {
headimg: headimg
},
success: res => {
if (res.code == 0) {
this.memberInfo.headimg = headimg;
this.$store.commit('setMemberInfo', this.memberInfo);
}
}
});
},
},
export default {
data() {
return {
diyRoute: '/pages/member/index'
};
},
computed: {},
watch: {
storeToken: function(nVal, oVal) {
if (nVal) {
this.initData();
if (uni.getStorageSync('source_member')) this.$util.onSourceMember(uni.getStorageSync('source_member'));
}
}
},
onLoad(data) {
uni.hideTabBar();
this.name = 'DIY_VIEW_MEMBER_INDEX';
if (data.code) {
this.$api.sendRequest({
url: '/wechat/api/wechat/authcodetoopenid',
data: {
code: data.code
},
success: res => {
if (res.code >= 0) {
if (res.data.userinfo.nickName) this.modifyNickname(res.data.userinfo.nickName);
if (res.data.userinfo.avatarUrl) this.modifyHeadimg(res.data.userinfo.avatarUrl);
}
}
});
}
},
onShow() {
// 刷新会员数据
if (this.$refs.diyGroup) {
if (this.$refs.diyGroup.$refs.diyMemberIndex) this.$refs.diyGroup.$refs.diyMemberIndex[0].init();
if (this.$refs.diyGroup.$refs.diyMemberMyOrder) this.$refs.diyGroup.$refs.diyMemberMyOrder[0].getOrderNum();
}
},
methods: {
/**
* 查询会员信息
*/
initData() {
if (this.storeToken) {
this.$nextTick(() => {
let callback = () => {
// 刷新会员数据
if (this.$refs.diyGroup) {
if (this.$refs.diyGroup.$refs.diyMemberIndex) {
this.$refs.diyGroup.$refs.diyMemberIndex[0].init();
}
}
}
this.$refs.nsNewGift.init(callback);
this.$refs.birthdayGift.init(callback);
});
}
},
/**
* 修改昵称
* @param {Object} nickName
*/
modifyNickname(nickName) {
this.$api.sendRequest({
url: '/api/member/modifynickname',
data: {
nickname: nickName
},
success: res => {
if (res.code == 0) {
this.memberInfo.nickname = nickName;
this.$store.commit('setMemberInfo', this.memberInfo);
}
}
});
},
/**
* 修改头像
*/
modifyHeadimg(headimg) {
this.$api.sendRequest({
url: '/api/member/modifyheadimg',
data: {
headimg: headimg
},
success: res => {
if (res.code == 0) {
this.memberInfo.headimg = headimg;
this.$store.commit('setMemberInfo', this.memberInfo);
}
}
});
},
},
};

View File

@@ -11,12 +11,12 @@
<text v-if="orderData.promotion_status_name">{{ orderData.promotion_status_name }}</text>
</view>
<view class="desc" v-if="orderData.promotion_type == 'presale' && orderData.order_status == 1">
预计{{ $util.timeStampTurnTime(orderData.predict_delivery_time, true) }}日后发货
预计{{ $util.timeStampTurnTime(orderData.predict_delivery_time, 'Y-m-d') }}发货
</view>
<view class="desc" v-if="orderData.close_cause">订单关闭原因{{ orderData.close_cause }}</view>
</view>
</view>
<view class="order-time" v-if="orderData.order_status == 0" id="action-date">
<view class="order-time" v-if="orderData.order_status == 0 && orderData.pay_type != 'offlinepay'" id="action-date">
剩余时间
<uni-count-down :day="orderData.closeTimeMachine.d" :hour="orderData.closeTimeMachine.h"
:minute="orderData.closeTimeMachine.i" :second="orderData.closeTimeMachine.s" color="#fff"
@@ -42,7 +42,7 @@
<view class="font-size-base">送达时间</view>
<view class="last-child">{{ orderData.buyer_ask_delivery_time }}</view>
</view>
<block v-if="orderData.package_list">
<block v-if="orderData.package_list.deliverer">
<view class="pick-block">
<view>配送员</view>
<view class="last-child">{{ orderData.package_list.deliverer }}</view>
@@ -133,6 +133,10 @@
{{ i < goodsItem.sku_spec_format.length - 1 ? '; ' : '' }}
</block>
</view>
<view class="goods-num">
<text class="iconfont icon-close"></text>
<text>{{ goodsItem.num }}</text>
</view>
</view>
<view class="goods-sub-section">
<view>
@@ -142,11 +146,9 @@
<text class="unit price-style small">.{{ parseFloat(goodsItem.price).toFixed(2).split('.')[1] }}</text>
</text>
</view>
<view>
<text class="font-size-base">
<text class="iconfont icon-close"></text>
{{ goodsItem.num }}
</text>
<view v-if="orderData.order_type == 1 && orderData.order_status == 1 && goodsItem.delivery_status == 1"
class="delivery-status color-base-text">
{{goodsItem.delivery_status_name}}
</view>
</view>
<view v-if="goodsItem.card_item_id" class="goods-card">
@@ -176,15 +178,11 @@
</view>
<view class="goods-action">
<block v-if="orderData.is_enable_refund">
<view @click="goRefund(goodsItem.order_goods_id)" v-if="orderData.order_scene == 'online' && (goodsItem.refund_status == 0 || goodsItem.refund_status == -1)">
<view class="order-box-btn" v-if="orderData.promotion_type != 'blindbox'">
{{ orderData.order_status == 10 ? '申请售后' : '申请退款' }}
</view>
</view>
</block>
<view @click="goRefundDetail(goodsItem.order_goods_id)" v-if="goodsItem.refund_status != 0 && goodsItem.refund_status != -1">
<view class="order-box-btn">{{ orderData.order_status == 10 ? '查看售后' : '查看退款' }}</view>
<view class="order-box-btn" @click="goRefund(goodsItem.order_goods_id)" v-if="orderData.is_enable_refund && orderData.order_scene == 'online' && goodsItem.refund_status == 0 && orderData.promotion_type != 'blindbox'">
{{ orderData.order_status == 10 ? '申请售后' : '申请退款' }}
</view>
<view class="order-box-btn" @click="goRefundDetail(goodsItem.order_goods_id)" v-if="goodsItem.refund_status != 0">
{{ goodsItem.refund_status_name }}
</view>
</view>
</view>
@@ -319,15 +317,36 @@
<view class="box"><text class="color-base-text" @click="$util.redirectTo('/pages_promotion/cardservice/card/my_card')">查看</text></view>
</view>
</block>
<block v-if="orderData.pay_type=='offlinepay' && orderData.offline_pay_info">
<view class="hr"></view>
<view class="order-cell">
<text class="tit">支付方式</text>
<view class="box">
<text class="color-title">线下支付</text>
</view>
</view>
<view class="order-cell">
<text class="tit">支付状态</text>
<view class="box">
<text class="color-title">{{orderData.offline_pay_info.status_info.name}}</text>
</view>
</view>
<view class="order-cell remark" v-if="orderData.offline_pay_info.status_info.const=='AUDIT_REFUSE'">
<text class="tit">审核备注</text>
<view class="box">
<text class="color-title">{{orderData.offline_pay_info.audit_remark}}</text>
</view>
</view>
</block>
<!-- 联系客服 -->
<!-- <ns-contact :niushop="{ order_id: orderData.order_id }">
<ns-contact :niushop="{ order_id: orderData.order_id }">
<view class="kefu">
<view>
<text class="iconfont icon-ziyuan"></text>
<text>联系客服</text>
</view>
</view>
</ns-contact> -->
</ns-contact>
</view>
<block v-if="orderData.virtual_goods && orderData.goods_class == 2 && orderData.virtual_goods.is_veirfy == 0">
@@ -362,7 +381,7 @@
</view>
</view>
</view>
<view class="verify-info-wrap">
<view class="head">核销记录</view>
<view v-if="orderData.virtual_goods.verify_record.length">
@@ -598,8 +617,7 @@
</view>
<!-- 订单 -->
<view class="fixed-bottom-box bottom-safe-area" v-if="orderData.action.length > 0 || (orderData.is_evaluate == 1 && evaluateConfig.evaluate_status == 1)">
</view>
<view class="fixed-bottom-box bottom-safe-area" v-if="orderData.action.length > 0 || (orderData.is_evaluate == 1 && evaluateConfig.evaluate_status == 1)"></view>
<ns-goods-recommend ref="goodrecommend" route="order_detail"></ns-goods-recommend>
<!-- 选择支付方式弹窗 -->
@@ -646,6 +664,12 @@
if (option.order_id) this.orderId = option.order_id;
if (option.merchant_trade_no) this.merchantTradeNo = option.merchant_trade_no;
},
onPullDownRefresh() {
this.getOrderData();
setTimeout(function () {
uni.stopPullDownRefresh();
}, 50);
},
onShow() {
this.isIphoneX = this.$util.uniappIsIPhoneX();
@@ -657,6 +681,7 @@
back: '/pages/order/detail?order_id=' + this.orderId + '&merchant_trade_no=' + this.merchantTradeNo
});
}
if(this.$refs.choosePaymentPopup) this.$refs.choosePaymentPopup.pageShow()
},
methods: {
goDetail(e) {
@@ -733,11 +758,20 @@
/**
* 下拉刷新
*/
onPullDownRefresh() {
this.getOrderData();
},
operation(action) {
switch (action) {
case 'orderDelete':
this.orderDelete(this.orderData.order_id, () => {
setTimeout(()=>{
if (getCurrentPages().length == 1) {
this.$util.redirectTo('/pages/member/index')
} else {
uni.navigateBack();
}
},500)
});
break;
case 'orderPay': // 支付
this.orderPay(this.orderData);
break;
@@ -772,6 +806,11 @@
this.getOrderData();
});
break;
case 'orderOfflinePay':
this.$util.redirectTo('/pages_tool/pay/offlinepay', {
outTradeNo: this.orderData.out_trade_no
});
break;
}
},
imageError(index) {

View File

@@ -80,14 +80,14 @@
</view>
</view>
<!-- 联系客服 -->
<!-- <ns-contact :niushop="{ order_id: orderData.order_id }">
<ns-contact :niushop="{ order_id: orderData.order_id }">
<view class="kefu">
<view>
<text class="iconfont icon-ziyuan"></text>
<text>联系客服</text>
</view>
</view>
</ns-contact> -->
</ns-contact>
</view>
<!-- 订单金额 -->
@@ -127,8 +127,7 @@
<ns-goods-recommend ref="goodrecommend" route="order_detail"></ns-goods-recommend>
<!-- 选择支付方式弹窗 -->
<ns-payment ref="choosePaymentPopup" :payMoney="orderData.order_money"
@confirm="orderPay(orderData)"></ns-payment>
<ns-payment ref="choosePaymentPopup" :payMoney="orderData.order_money" @confirm="orderPay(orderData)"></ns-payment>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>

View File

@@ -1,7 +1,7 @@
<template>
<page-meta :page-style="themeColor"></page-meta>
<view class="order-container">
<view class="cate-search">
<view class="cate-search" v-if="storeToken">
<view class="search-box">
<input class="uni-input" maxlength="50" v-model="searchText" confirm-type="search" placeholder="请输入商品名称/订单编号" @confirm="search()" />
<text class="iconfont icon-sousuo3" @click="search()"></text>
@@ -18,137 +18,138 @@
<!-- #ifdef MP -->
<mescroll-uni ref="mescroll" @getData="getListData" top="176rpx" v-if="storeToken">
<!-- #endif -->
<!-- #ifndef MP -->
<mescroll-uni ref="mescroll" @getData="getListData" top="196rpx" v-if="storeToken">
<!-- #endif -->
<block slot="list">
<view class="order-list" v-if="orderList.length > 0">
<view class="order-item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex">
<view class="order-header" :class="{ waitpay: orderStatus == 'waitpay' && orderItem.order_status == 0 }">
<!-- <view class="iconfont"
:class="$util.inArray(orderItem.order_id, mergePayOrder) == -1 ? 'icon-yuan_checkbox' : 'icon-yuan_checked color-base-text'"
@click="selectOrder(orderItem.order_id, orderItem.pay_money)"
v-if="orderStatus == 'waitpay' && orderItem.order_status == 0"></view> -->
<text class="order-no">订单号{{ orderItem.order_no }}</text>
<text class="order-type-name">{{ orderItem.order_type_name }}</text>
<text class="status-name">{{ orderItem.order_status_name }}</text>
</view>
<view class="order-body" @click="orderDetail(orderItem)">
<block v-if="orderItem.order_goods.length == 1">
<view class="goods-wrap" v-for="(goodsItem, goodsIndex) in orderItem.order_goods" :key="goodsIndex">
<view class="goods-img">
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(orderIndex, goodsIndex)" mode="aspectFill" :lazy-load="true"/>
</view>
<view class="goods-info">
<view class="pro-info">
<view class="goods-name" v-if="goodsItem.goods_class == 2">{{ goodsItem.goods_name }}</view>
<view class="goods-name" v-else>{{ goodsItem.sku_name }}</view>
<view class="sku" v-if="goodsItem.sku_spec_format">
<view class="goods-spec">
<block v-for="(x, i) in goodsItem.sku_spec_format" :key="i">
{{ x.spec_value_name }}
{{ i < goodsItem.sku_spec_format.length - 1 ? '; ' : '' }}
</block>
</view>
<!-- #ifndef MP -->
<mescroll-uni ref="mescroll" @getData="getListData" top="196rpx" v-if="storeToken">
<!-- #endif -->
<block slot="list">
<view class="order-list" v-if="orderList.length > 0">
<view class="order-item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex">
<view class="order-header" :class="{ waitpay: orderStatus == 'waitpay' && orderItem.order_status == 0 }">
<!-- <view class="iconfont"
:class="$util.inArray(orderItem.order_id, mergePayOrder) == -1 ? 'icon-yuan_checkbox' : 'icon-yuan_checked color-base-text'"
@click="selectOrder(orderItem.order_id, orderItem.pay_money)"
v-if="orderStatus == 'waitpay' && orderItem.order_status == 0"></view> -->
<text class="order-no">订单号{{ orderItem.order_no }}</text>
<text class="order-type-name">{{ orderItem.order_type_name }}</text>
<text class="status-name">{{ orderItem.order_status_name }}</text>
</view>
<view class="order-body" @click="orderDetail(orderItem)">
<block v-if="orderItem.order_goods.length == 1">
<view class="goods-wrap" v-for="(goodsItem, goodsIndex) in orderItem.order_goods" :key="goodsIndex">
<view class="goods-img">
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(orderIndex, goodsIndex)" mode="aspectFill" :lazy-load="true"/>
</view>
<view class="goods-info">
<view class="pro-info">
<view class="goods-name" v-if="goodsItem.goods_class == 2">{{ goodsItem.goods_name }}</view>
<view class="goods-name" v-else>{{ goodsItem.sku_name }}</view>
<view class="sku" v-if="goodsItem.sku_spec_format">
<view class="goods-spec">
<block v-for="(x, i) in goodsItem.sku_spec_format" :key="i">
{{ x.spec_value_name }}
{{ i < goodsItem.sku_spec_format.length - 1 ? '; ' : '' }}
</block>
</view>
</view>
<!-- <view class="goods-sub-section">
<text class="goods-price">
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
<text class="price-style large">{{ parseFloat(goodsItem.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-style small">.{{ parseFloat(goodsItem.price).toFixed(2).split(".")[1] }}</text>
</text>
<text class="goods-num">
<text class="iconfont icon-close"></text>
{{ goodsItem.num }}
</text>
</view> -->
<view class="goods-action"><!-- <view class="action-btn">加购物车</view> -->
</view>
</view>
</view>
</block>
<block v-else>
<view class="multi-order-goods">
<scroll-view scroll-x="true" class="scroll-view">
<view class="goods-wrap">
<view class="goods-img" v-for="(goodsItem, goodsIndex) in orderItem.order_goods" :key="goodsIndex">
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(orderIndex, goodsIndex)" mode="aspectFill" :lazy-load="true"/>
</view>
</view>
</scroll-view>
<view class="shade">
<image :src="$util.img('public/uniapp/order/order-shade.png')"></image>
</view>
</view>
</block>
</view>
<view class="order-footer">
<view class="order-base-info">
<view class="total">
<text class="font-size-sub">{{ orderItem.goods_num }}件商品</text>
<text class="align-right font-size-base">
实付款
<text class="font-size-base price-font">{{ $lang('common.currencySymbol') }}{{ orderItem.order_money }}</text>
<!-- <view class="goods-sub-section">
<text class="goods-price">
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
<text class="price-style large">{{ parseFloat(goodsItem.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-style small">.{{ parseFloat(goodsItem.price).toFixed(2).split(".")[1] }}</text>
</text>
<text class="goods-num">
<text class="iconfont icon-close"></text>
{{ goodsItem.num }}
</text>
</view> -->
<view class="goods-action"><!-- <view class="action-btn">加购物车</view> -->
</view>
</view>
</view>
<view class="order-action" v-if="orderItem.action.length > 0">
<view class="order-time" v-if="orderItem.order_status == 0" id="action-date">
<image :src="$util.img('public/uniapp/order/time.png')"></image>
剩余时间
<uni-count-down :day="orderItem.discountTimeMachine.d"
:hour="orderItem.discountTimeMachine.h"
:minute="orderItem.discountTimeMachine.i"
:second="orderItem.discountTimeMachine.s" color="#FF4644"
splitorColor="#FF4644" />
</view>
<view class="order-box-btn"
v-if="evaluateConfig.evaluate_status == 1 && orderItem.is_evaluate == 1"
@click="operation('memberOrderEvaluation', orderItem)">
<text v-if="orderItem.evaluate_status == 0">评价</text>
<text v-else-if="orderItem.evaluate_status == 1">追评</text>
</view>
<view class="order-box-btn"
:class="{ 'color-base-border color-base-bg': operationItem.action == 'orderPay' }"
v-for="(operationItem, operationIndex) in orderItem.action"
:key="operationIndex" @click="operation(operationItem.action, orderItem)">
{{ operationItem.title }}
</block>
<block v-else>
<view class="multi-order-goods">
<scroll-view scroll-x="true" class="scroll-view">
<view class="goods-wrap">
<view class="goods-img" v-for="(goodsItem, goodsIndex) in orderItem.order_goods" :key="goodsIndex">
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(orderIndex, goodsIndex)" mode="aspectFill" :lazy-load="true"/>
</view>
</view>
</scroll-view>
<view class="shade">
<image :src="$util.img('public/uniapp/order/order-shade.png')"></image>
</view>
</view>
<view class="order-action" v-else-if="orderItem.action.length == 0 && orderItem.is_evaluate == 1 && evaluateConfig.evaluate_status == 1">
<view class="order-box-btn" v-if="orderItem.is_evaluate == 1" @click="operation('memberOrderEvaluation', orderItem)">
<text v-if="orderItem.evaluate_status == 0">评价</text>
<text v-else-if="orderItem.evaluate_status == 1">追评</text>
</view>
</block>
</view>
<view class="order-footer">
<view class="order-base-info">
<view class="total">
<text class="font-size-sub">{{ orderItem.goods_num }}件商品</text>
<text class="align-right font-size-base">
实付款
<text class="font-size-base price-font">{{ $lang('common.currencySymbol') }}{{ orderItem.order_money }}</text>
</text>
</view>
<view class="order-action" v-else>
<view class="order-box-btn" @click="orderDetail(orderItem)">查看详情</view>
</view>
<view class="order-action" v-if="orderItem.action.length > 0">
<view class="order-time" v-if="orderItem.order_status == 0 && orderItem.pay_type !== 'offlinepay'" id="action-date">
<image :src="$util.img('public/uniapp/order/time.png')"></image>
剩余时间
<uni-count-down :day="orderItem.discountTimeMachine.d"
:hour="orderItem.discountTimeMachine.h"
:minute="orderItem.discountTimeMachine.i"
:second="orderItem.discountTimeMachine.s" color="#FF4644"
splitorColor="#FF4644" />
</view>
<view class="order-box-btn"
v-if="evaluateConfig.evaluate_status == 1 && orderItem.is_evaluate == 1"
@click="operation('memberOrderEvaluation', orderItem)">
<text v-if="orderItem.evaluate_status == 0">评价</text>
<text v-else-if="orderItem.evaluate_status == 1">追评</text>
</view>
<view class="order-box-btn"
:class="{ 'color-base-border color-base-bg': operationItem.action == 'orderPay' }"
v-for="(operationItem, operationIndex) in orderItem.action"
:key="operationIndex" @click="operation(operationItem.action, orderItem)">
{{ operationItem.title }}
</view>
</view>
<view class="order-action" v-else-if="orderItem.action.length == 0 && orderItem.is_evaluate == 1 && evaluateConfig.evaluate_status == 1">
<view class="order-box-btn" v-if="orderItem.is_evaluate == 1" @click="operation('memberOrderEvaluation', orderItem)">
<text v-if="orderItem.evaluate_status == 0">评价</text>
<text v-else-if="orderItem.evaluate_status == 1">追评</text>
</view>
</view>
<view class="order-action" v-else>
<view class="order-box-btn" @click="orderDetail(orderItem)">查看详情</view>
</view>
</view>
</view>
<view v-else><ns-empty :isIndex="false" :text="$lang('emptyTips')"></ns-empty></view>
</block>
</mescroll-uni>
</view>
<view v-else><ns-empty :isIndex="false" :text="$lang('emptyTips')"></ns-empty></view>
</block>
</mescroll-uni>
<view v-if="!storeToken" class="no-login">
<view><ns-empty :isIndex="false" :text="$lang('emptyTips')"></ns-empty></view>
<button type="primary" size="mini" class="button mini" @click="toLogin">去登录</button>
</view>
<!-- <view class="order-batch-action" :class="{ 'bottom-safe-area': isIphoneX }" v-if="mergePayOrder.length">
<view class="action-btn color-base-text color-base-border" @click="mergePay()">合并付款</view>
</view> -->
<!-- 选择支付方式弹窗 -->
<payment ref="choosePaymentPopup"></payment>
<!-- 选择支付方式弹窗 -->
<ns-payment ref="choosePaymentPopup"></ns-payment>
<ns-payment ref="choosePaymentMergePopup"></ns-payment>
<ns-login ref="login"></ns-login>
<loading-cover ref="loadingCover"></loading-cover>
<ns-login ref="login"></ns-login>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
import orderMethod from './public/js/orderMethod.js';
import nsPayment from '@/components/payment/payment.vue';
import payment from '@/components/payment/payment.vue';
export default {
data() {
@@ -176,7 +177,7 @@
};
},
components: {
nsPayment
payment
},
mixins: [orderMethod],
onLoad(option) {
@@ -192,14 +193,19 @@
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
} else {
this.$nextTick(() => {
this.$refs.login.open('/pages/order/list?status=' + this.orderStatus);
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
// this.$refs.login.open('/pages/order/list?status=' + this.orderStatus);
})
}
if(this.$refs.choosePaymentPopup) this.$refs.choosePaymentPopup.pageShow()
},
onUnload() {
if (!this.storeToken && this.$refs.login) this.$refs.login.cancelCompleteInfo();
},
methods: {
toLogin() {
this.$refs.login.open();
},
ontabtap(e) {
let index = e.target.dataset.current || e.currentTarget.dataset.current;
this.orderStatus = this.statusList[index].status;
@@ -208,7 +214,7 @@
this.$refs.mescroll.refresh();
},
getListData(mescroll) {
this.$api.sendRequest({
url: '/api/order/lists',
data: {
@@ -268,39 +274,39 @@
getOrderStatus() {
this.statusList = [{
status: 'all',
name:'全部',
name: this.$lang('all'),
id: 'status_0'
},
{
status: 'waitpay',
name: '待付款',
name: this.$lang('waitPay'),
id: 'status_1'
},
{
status: 'waitsend',
name: '待发货',
name: this.$lang('readyDelivery'),
id: 'status_2'
},
{
status: 'waitconfirm',
name: '待收货',
name: this.$lang('waitDelivery'),
id: 'status_3'
},
{
status: 'waitrate',
name: '已完成',
id: 'status_4'
},
/*{
status: 'wait_use',
name: '待使用',
name: this.$lang('waitUse'),
id: 'status_4'
}*/
}
];
},
operation(action, orderData) {
let index = this.status;
switch (action) {
case 'orderDelete':
this.orderDelete(orderData.order_id, () => {
this.$refs.mescroll.refresh();
});
break;
case 'orderPay': // 支付
this.orderData = orderData;
this.payMoney = parseFloat(orderData.pay_money);
@@ -339,34 +345,18 @@
this.$refs.mescroll.refresh();
});
break;
case 'orderOfflinePay':
this.orderData = orderData;
this.$util.redirectTo('/pages_tool/pay/offlinepay', {
outTradeNo: this.orderData.out_trade_no
});
break;
}
},
orderDetail(data) {
switch (parseInt(data.order_type)) {
case 2:
// 自提订单
this.$util.redirectTo('/pages/order/detail_pickup', {
order_id: data.order_id
});
break;
case 3:
// 本地配送订单
this.$util.redirectTo('/pages/order/detail_local_delivery', {
order_id: data.order_id
});
break;
case 4:
// 虚拟订单
this.$util.redirectTo('/pages_tool/order/detail_virtual', {
order_id: data.order_id
});
break;
default:
this.$util.redirectTo('/pages/order/detail', {
order_id: data.order_id
});
break;
}
this.$util.redirectTo('/pages/order/detail', {
order_id: data.order_id
});
},
/**
* 选择订单
@@ -381,28 +371,6 @@
this.mergePayOrder.push(orderId);
}
},
/**
* 合并支付
*/
mergePay() {
if (this.mergePayOrder.length) {
this.$api.sendRequest({
url: '/api/order/pay',
data: {
order_ids: this.mergePayOrder.toString()
},
success: res => {
if (res.code >= 0) {
this.$refs.choosePaymentMergePopup.getPayInfo(res.data);
} else {
this.$util.showToast({
title: res.message
});
}
}
});
}
},
imageError(orderIndex, goodsIndex) {
this.orderList[orderIndex].order_goods[goodsIndex].sku_image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
@@ -450,4 +418,18 @@
/deep/ .mescroll-upwarp {
padding-bottom: 100rpx;
}
.no-login{
display: flex;
flex-direction: column;
align-items: center;
}
.no-login .button{
width: 300rpx;
margin-top: 100rpx;
height: 70rpx;
line-height: 70rpx !important;
font-size: 28rpx;
border-radius: 50rpx;
}
</style>

View File

@@ -435,7 +435,7 @@ view {
line-height: 1.3;
display: flex;
margin-top: 20rpx;
align-items: center;
.goods-price {
font-weight: 700;
font-size: $font-size-activity-tag;
@@ -525,7 +525,9 @@ view {
align-items: center;
background: #fff;
line-height: 40rpx;
&.remark{
align-items: flex-start !important;
}
.tit {
text-align: left;
}
@@ -847,7 +849,13 @@ view {
white-space: nowrap;
flex: 1;
}
.goods-num{
font-size: 22rpx;
margin-left: 20rpx;
}
.delivery-status{
line-height: 1.3;
}
.fixed-bottom {
width: 100%;
position: fixed;

View File

@@ -1,5 +1,36 @@
export default {
methods: {
/**
* 删除订单
* @param {Object} orderData
*/
orderDelete(order_id, callback) {
uni.showModal({
title: '提示',
content: '您确定要删除该订单吗?',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/api/order/delete',
data: {
order_id
},
success: res => {
if (res.code >= 0) {
this.$util.showToast({title:'删除订单成功'})
typeof callback == 'function' && callback();
} else {
this.$util.showToast({
title: '删除订单失败,' + res.message,
duration: 2000
})
}
}
})
}
}
})
},
/**
* 订单支付
* @param {Object} orderData
@@ -57,8 +88,7 @@ export default {
typeof callback == 'function' && callback();
} else {
this.$util.showToast({
title: '当前订单可能存在拼团,维权等操作' + res.message +
'不可以关闭哦!',
title: '关闭失败' + res.message,
duration: 2000
})
}