chore(组件): privacyPopup 组件全部使用注册机制

This commit is contained in:
2026-01-05 18:11:14 +08:00
parent 73f9cb8820
commit 405f37a3f6
42 changed files with 2544 additions and 2721 deletions

View File

@@ -169,8 +169,6 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import DiyMinx from './minx.js'
export default {
name: 'diy-index-page',
@@ -190,9 +188,6 @@ export default {
}
},
mixins: [DiyMinx],
components: {
MescrollUni
},
data() {
return {
pageIndex: 0, //当前选中分类id

View File

@@ -103,9 +103,7 @@
</template>
<script>
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import auth from '@/common/js/auth.js';
import validate from '@/common/js/validate.js';
@@ -113,11 +111,6 @@ import validate from '@/common/js/validate.js';
export default {
mixins: [auth],
name: 'ns-login',
components: {
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
url: '',

View File

@@ -1,4 +1,5 @@
<template>
<!-- #ifdef MP -->
<view v-if="showPop">
<view class="privacy-mask">
<view class="privacy-wrap">
@@ -15,6 +16,10 @@
</view>
</view>
</view>
<!-- #endif -->
<!-- #ifdef WEB || H5 -->
<view v-if="showPop"></view>
<!-- #endif -->
</template>
<script>

57
package-lock.json generated
View File

@@ -1,11 +1,15 @@
{
"name": "uniappsaas",
"name": "frontend",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"jweixin-module": "^1.6.0"
},
"devDependencies": {
"terser-webpack-plugin": "^5.3.10"
"terser-webpack-plugin": "^5.3.10",
"zion-uniapp-mp-load-package": "^1.0.13"
}
},
"node_modules/@jridgewell/gen-mapping": {
@@ -619,6 +623,25 @@
"dev": true,
"license": "MIT"
},
"node_modules/json5": {
"version": "2.2.3",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true,
"license": "MIT",
"bin": {
"json5": "lib/cli.js"
},
"engines": {
"node": ">=6"
}
},
"node_modules/jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==",
"license": "ISC"
},
"node_modules/loader-runner": {
"version": "4.3.0",
"resolved": "https://repo.huaweicloud.com/repository/npm/loader-runner/-/loader-runner-4.3.0.tgz",
@@ -981,6 +1004,16 @@
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/zion-uniapp-mp-load-package": {
"version": "1.0.13",
"resolved": "https://registry.npmmirror.com/zion-uniapp-mp-load-package/-/zion-uniapp-mp-load-package-1.0.13.tgz",
"integrity": "sha512-QKJ6azXsJh9dVpjVS/48bGQELSI3FFtQ3QZic/Gs5z6v77BVjY7uGCXKxGuCwNwijtJnm8FRzlFGTVcQYU+wXA==",
"dev": true,
"license": "MIT",
"dependencies": {
"json5": "^2.2.3"
}
}
},
"dependencies": {
@@ -1456,6 +1489,17 @@
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
"json5": {
"version": "2.2.3",
"resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true
},
"jweixin-module": {
"version": "1.6.0",
"resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz",
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
},
"loader-runner": {
"version": "4.3.0",
"resolved": "https://repo.huaweicloud.com/repository/npm/loader-runner/-/loader-runner-4.3.0.tgz",
@@ -1681,6 +1725,15 @@
"integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==",
"dev": true,
"peer": true
},
"zion-uniapp-mp-load-package": {
"version": "1.0.13",
"resolved": "https://registry.npmmirror.com/zion-uniapp-mp-load-package/-/zion-uniapp-mp-load-package-1.0.13.tgz",
"integrity": "sha512-QKJ6azXsJh9dVpjVS/48bGQELSI3FFtQ3QZic/Gs5z6v77BVjY7uGCXKxGuCwNwijtJnm8FRzlFGTVcQYU+wXA==",
"dev": true,
"requires": {
"json5": "^2.2.3"
}
}
}
}

View File

@@ -3,7 +3,8 @@
"mp-weixin": "node scripts/mp-weixin.patch.js"
},
"devDependencies": {
"terser-webpack-plugin": "^5.3.10"
"terser-webpack-plugin": "^5.3.10",
"zion-uniapp-mp-load-package": "^1.0.13"
},
"dependencies": {
"jweixin-module": "^1.6.0"

View File

@@ -954,7 +954,8 @@
"autoscan": true,
"custom": {
"diy-*(\\W.*)": "@/components-diy/diy$1.vue",
"uni-*(\\W.*)": "@/uni_modules/uni$1/components/uni$1/uni$1.vue"
"uni-*(\\W.*)": "@/uni_modules/uni$1/components/uni$1/uni$1.vue",
"MescrollUni": "@/components/mescroll/my-list-mescroll.vue"
}
},
"preloadRule": {

View File

@@ -149,22 +149,12 @@
<script>
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import diyJs from '@/common/js/diy.js';
import scroll from '@/common/js/scroll-view.js';
import indexJs from './public/js/index.js';
export default {
components: {
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
mixins: [diyJs, scroll, indexJs]
};
</script>

View File

@@ -366,19 +366,10 @@
</template>
<script>
import scroll from '@/common/js/scroll-view.js';
import cart from './public/js/cart.js';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
mixins: [scroll, cart]
};
</script>

View File

@@ -25,15 +25,7 @@
</template>
<script>
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
diyData: null

View File

@@ -524,17 +524,8 @@
import detail from './public/js/detail.js';
import scroll from '@/common/js/scroll-view.js';
import goodsDetailBase from '@/common/js/goods_detail_base.js';
// 按需引入全局组件
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
// #ifdef MP-WEIXIN
privacyPopup,
// #endif
},
mixins: [goodsDetailBase, detail, scroll]
};
</script>

View File

@@ -307,19 +307,9 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import list from './public/js/list.js';
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {};
},

View File

@@ -166,13 +166,8 @@
<script>
import orderMethod from './public/js/orderMethod.js';
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
export default {
components: {
MescrollUni,
},
data() {
return {
scrollInto: '',

View File

@@ -3,7 +3,8 @@
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8">
<block slot="list">
<view class="balances" v-if="accountList.length" v-for="item in accountList" :key="item.id">
<image v-if="item.type == 'order'" :src="$util.img('public/uniapp/fenxiao/bill/jiesuan.png')" mode="widthFix"></image>
<image v-if="item.type == 'order'" :src="$util.img('public/uniapp/fenxiao/bill/jiesuan.png')"
mode="widthFix"></image>
<image v-else :src="$util.img('public/uniapp/fenxiao/bill/withdraw.png')" mode="widthFix"></image>
<view class="balances-info">
<text>{{ item.type_name }}</text>
@@ -11,7 +12,8 @@
<text>{{ $util.timeStampTurnTime(item.create_time) }}</text>
</view>
<view class="balances-num">
<text :class="item.money > 0 ? 'color-base-text' : ''">{{ item.money > 0 ? '+' + item.money : item.money }}</text>
<text :class="item.money > 0 ? 'color-base-text' : ''">{{ item.money > 0 ? '+' + item.money :
item.money }}</text>
</view>
</view>
<ns-empty v-if="!accountList.length && showEmpty" text="暂无账单信息" :isIndex="false"></ns-empty>
@@ -22,11 +24,6 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
data() {
return {
@@ -34,14 +31,8 @@ export default {
showEmpty: true
};
},
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
onShow() {
setTimeout( () => {
setTimeout(() => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
@@ -52,7 +43,7 @@ export default {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
},1000);
}, 1000);
},
methods: {
getData(mescroll) {

View File

@@ -40,10 +40,6 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
@@ -53,12 +49,6 @@ export default {
emptyShow: false,
};
},
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
mixins: [fenxiaoWords],
onShow() {
setTimeout(() => {

View File

@@ -132,20 +132,10 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import list from './public/js/goods_list.js';
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
mixins: [list, fenxiaoWords]
};
</script>

View File

@@ -42,7 +42,7 @@
<view class="goods-sub-section">
<view class="goods-price">
<text class="unit price-style small">{{ $lang('common.currencySymbol')
}}</text>
}}</text>
<text class="price-color price-style large">{{
parseFloat(orderItem.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-style small">.{{
@@ -96,18 +96,8 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
category: [

View File

@@ -103,19 +103,7 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
list: [],

View File

@@ -72,19 +72,9 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
orderList: [],

View File

@@ -83,18 +83,8 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
levelList: [

View File

@@ -34,19 +34,9 @@
</view>
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
withdrawState: {

View File

@@ -317,19 +317,9 @@
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import list from './public/js/list.js';
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {};
},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -2,9 +2,9 @@
<view class="order-container" :style="themeColor" :class="{ 'safe-area': isIphoneX }">
<!-- #ifdef MP-WEIXIN -->
<view class="payment-navbar" :style="{
'padding-top': menuButtonBounding.top + 'px',
height: menuButtonBounding.height + 'px'
}">
'padding-top': menuButtonBounding.top + 'px',
height: menuButtonBounding.height + 'px'
}">
<view class="nav-wrap">
<text class="iconfont icon-back_light" @click="back"></text>
<view class="navbar-title">确认订单</view>
@@ -18,11 +18,12 @@
<!-- 选择地址 -->
<template v-if="orderPaymentData.exchange_info.type == 1 && orderPaymentData.is_virtual == 0">
<!-- 配送方式 -->
<view class="delivery-mode" v-if="orderCreateData.delivery &&orderPaymentData.delivery.express_type.length > 1">
<view class="delivery-mode"
v-if="orderCreateData.delivery && orderPaymentData.delivery.express_type.length > 1">
<view class="action">
<view v-for="(deliveryItem, deliveryIndex) in orderPaymentData.delivery.express_type"
:key="deliveryIndex"
:class="{active: deliveryItem.name == orderCreateData.delivery.delivery_type}"
:class="{ active: deliveryItem.name == orderCreateData.delivery.delivery_type }"
@click="selectDeliveryType(deliveryItem)">
{{ deliveryItem.title }}
<!-- 外圆角 -->
@@ -31,10 +32,12 @@
</view>
</view>
<view class="address-box" :class="{'not-delivery-type': orderPaymentData.delivery.express_type.length <= 1}"
<view class="address-box"
:class="{ 'not-delivery-type': orderPaymentData.delivery.express_type.length <= 1 }"
v-if="orderPaymentData.delivery.delivery_type != 'store'">
<block v-if="storeInfo.storeList.length > 1 && orderPaymentData.delivery.delivery_type == 'local'">
<view class="local-delivery-store" v-if="Object.keys(storeInfo.currStore).length" @click="$refs.deliveryPopup.open()">
<view class="local-delivery-store" v-if="Object.keys(storeInfo.currStore).length"
@click="$refs.deliveryPopup.open()">
<view class="info">
<text class="store-name">{{ storeInfo.currStore.store_name }}</text> 提供配送
</view>
@@ -49,14 +52,19 @@
</view>
</view>
</block>
<view class="info-wrap" :class="{'local': orderPaymentData.delivery.delivery_type == 'local'}" v-if="orderCreateData.member_address" @click="selectAddress">
<view class="info-wrap" :class="{ 'local': orderPaymentData.delivery.delivery_type == 'local' }"
v-if="orderCreateData.member_address" @click="selectAddress">
<view class="content">
<text class="name font-size-base">{{ orderCreateData.member_address.name ? orderCreateData.member_address.name : '' }}</text>
<text class="font-size-base mobile">{{ orderCreateData.member_address.mobile ? orderCreateData.member_address.mobile : '' }}</text>
<text class="name font-size-base">{{ orderCreateData.member_address.name ?
orderCreateData.member_address.name : '' }}</text>
<text class="font-size-base mobile">{{ orderCreateData.member_address.mobile ?
orderCreateData.member_address.mobile : '' }}</text>
<text class="cell-more iconfont icon-right"></text>
<view class="desc-wrap">
{{ orderCreateData.member_address.full_address ? orderCreateData.member_address.full_address : '' }}
{{ orderCreateData.member_address.address ? orderCreateData.member_address.address : '' }}
{{ orderCreateData.member_address.full_address ?
orderCreateData.member_address.full_address : '' }}
{{ orderCreateData.member_address.address ? orderCreateData.member_address.address : ''
}}
</view>
</view>
</view>
@@ -69,11 +77,14 @@
<!-- 外卖配送 -->
<block v-if="orderPaymentData.delivery.delivery_type == 'local'">
<view class="local-box" v-if="orderPaymentData.config.local.is_use && orderPaymentData.delivery.local.info && orderPaymentData.delivery.local.info.time_is_open == 1">
<view class="local-box"
v-if="orderPaymentData.config.local.is_use && orderPaymentData.delivery.local.info && orderPaymentData.delivery.local.info.time_is_open == 1">
<view class="pick-block" @click="localtime">
<view class="font-size-base">送达时间</view>
<view class="time-picker">
<text :class="{'color-tip': !orderCreateData.buyer_ask_delivery_title}">{{ orderCreateData.buyer_ask_delivery_title ? orderCreateData.buyer_ask_delivery_title : '请选择送达时间' }}</text>
<text :class="{ 'color-tip': !orderCreateData.buyer_ask_delivery_title }">{{
orderCreateData.buyer_ask_delivery_title ?
orderCreateData.buyer_ask_delivery_title : '请选择送达时间' }}</text>
<text class="iconfont icon-right cell-more"></text>
</view>
</view>
@@ -82,7 +93,9 @@
<image class="address-line" :src="$util.img('public/uniapp/order/address-line.png')"></image>
</view>
<view class="store-box" :class="{'not-delivery-type': orderPaymentData.delivery.express_type.length <= 1}" v-if="orderPaymentData.delivery.delivery_type == 'store' && storeInfo.currStore">
<view class="store-box"
:class="{ 'not-delivery-type': orderPaymentData.delivery.express_type.length <= 1 }"
v-if="orderPaymentData.delivery.delivery_type == 'store' && storeInfo.currStore">
<block v-if="storeInfo.currStore">
<view @click="openSiteDelivery" class="store-info">
<view class="store-address-info">
@@ -104,20 +117,22 @@
<view class="mobile-wrap store-mobile">
<view class="form-group">
<text class="text">姓名</text>
<input type="text" placeholder-class="color-tip placeholder" class="input" v-model="member_address.name" disabled />
<input type="text" placeholder-class="color-tip placeholder" class="input"
v-model="member_address.name" disabled />
</view>
</view>
<view class="mobile-wrap store-mobile">
<view class="form-group">
<text class="text">预留手机</text>
<input type="number" maxlength="11" placeholder="请输入您的手机号码"
placeholder-class="color-tip placeholder" class="input" v-model="member_address.mobile" />
placeholder-class="color-tip placeholder" class="input"
v-model="member_address.mobile" />
</view>
</view>
<view class="store-time">
<view class="left">自提时间</view>
<view class="right" @click="storetime">
{{orderCreateData.buyer_ask_delivery_title}}
{{ orderCreateData.buyer_ask_delivery_title }}
<text class="iconfont icon-right"></text>
</view>
</view>
@@ -137,27 +152,35 @@
<view class="form-group">
<text class="iconfont icon-dianhua2"></text>
<text class="text">手机号码</text>
<input type="number" maxlength="11" placeholder="请输入您的手机号码" placeholder-class="color-tip placeholder" class="input" v-model="orderCreateData.member_address.mobile" />
<input type="number" maxlength="11" placeholder="请输入您的手机号码"
placeholder-class="color-tip placeholder" class="input"
v-model="orderCreateData.member_address.mobile" />
</view>
</view>
<!-- 店铺 -->
<view class="site-wrap" :class="orderPaymentData.exchange_info.type == 2 || orderPaymentData.exchange_info.type == 3 ? 'margin-top' : ''">
<view class="site-wrap"
:class="orderPaymentData.exchange_info.type == 2 || orderPaymentData.exchange_info.type == 3 ? 'margin-top' : ''">
<view class="site-body">
<view class="goods-wrap">
<block v-if="orderPaymentData.exchange_info.type == 2">
<view class="goods-img">
<image :src="orderPaymentData.exchange_info.image ? $util.img(orderPaymentData.exchange_info.image) : $util.img('public/uniapp/point/coupon.png')" @error="imageError()" mode="aspectFill"/>
<image
:src="orderPaymentData.exchange_info.image ? $util.img(orderPaymentData.exchange_info.image) : $util.img('public/uniapp/point/coupon.png')"
@error="imageError()" mode="aspectFill" />
</view>
</block>
<block v-else-if="orderPaymentData.exchange_info.type == 3">
<view class="goods-img">
<image :src="orderPaymentData.exchange_info.image ? $util.img(orderPaymentData.exchange_info.image) : $util.img('public/uniapp/point/hongbao.png')" @error="imageError()" mode="aspectFill"/>
<image
:src="orderPaymentData.exchange_info.image ? $util.img(orderPaymentData.exchange_info.image) : $util.img('public/uniapp/point/hongbao.png')"
@error="imageError()" mode="aspectFill" />
</view>
</block>
<block v-else>
<view class="goods-img">
<image :src="$util.img(orderPaymentData.exchange_info.image)" @error="imageError()" mode="aspectFill"/>
<image :src="$util.img(orderPaymentData.exchange_info.image)" @error="imageError()"
mode="aspectFill" />
</view>
</block>
<view class="goods-info">
@@ -182,7 +205,8 @@
<view class="site-footer">
<view class="order-cell">
<text class="tit">买家留言</text>
<view class="box"><input type="text" placeholder="留言前建议先与商家协调一致" placeholder-class="color-tip" v-model="orderCreateData.buyer_message" /></view>
<view class="box"><input type="text" placeholder="留言前建议先与商家协调一致" placeholder-class="color-tip"
v-model="orderCreateData.buyer_message" /></view>
</view>
</view>
</view>
@@ -196,7 +220,8 @@
<text class="unit">积分</text>
</view>
</view>
<view class="order-cell" v-if="orderPaymentData.exchange_info.type == 1 && orderPaymentData.delivery_money > 0">
<view class="order-cell"
v-if="orderPaymentData.exchange_info.type == 1 && orderPaymentData.delivery_money > 0">
<text class="tit">运费</text>
<view class="box">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
@@ -206,8 +231,9 @@
</view>
<view class="error-message" v-if="orderPaymentData.delivery && orderPaymentData.delivery.delivery_type == 'local' && orderPaymentData.delivery && orderPaymentData.delivery.error && orderPaymentData.delivery.error !== ''">
{{orderPaymentData.delivery.error_msg}}
<view class="error-message"
v-if="orderPaymentData.delivery && orderPaymentData.delivery.delivery_type == 'local' && orderPaymentData.delivery && orderPaymentData.delivery.error && orderPaymentData.delivery.error !== ''">
{{ orderPaymentData.delivery.error_msg }}
</view>
<view class="order-submit" :class="{ 'bottom-safe-area': isIphoneX }">
<view class="order-settlement-info">
@@ -221,12 +247,14 @@
</template>
</view>
<view class="submit-btn">
<button v-if="createBtn()" type="primary" class="mini" size="mini" @click="openChoosePayment()">提交订单</button>
<button v-if="createBtn()" type="primary" class="mini" size="mini"
@click="openChoosePayment()">提交订单</button>
<button v-else class="no-submit mini" size="mini">
<block v-if="orderPaymentData.delivery && orderPaymentData.delivery.delivery_type == 'local' && orderPaymentData.delivery && orderPaymentData.delivery.error && orderPaymentData.delivery.start_money > orderPaymentData.price">
{{ orderPaymentData.delivery.start_money-orderPaymentData.price | moneyFormat }}起送
<block
v-if="orderPaymentData.delivery && orderPaymentData.delivery.delivery_type == 'local' && orderPaymentData.delivery && orderPaymentData.delivery.error && orderPaymentData.delivery.start_money > orderPaymentData.price">
{{ orderPaymentData.delivery.start_money - orderPaymentData.price | moneyFormat }}起送
</block>
<block v-else >提交订单</block>
<block v-else>提交订单</block>
</button>
</view>
</view>
@@ -241,22 +269,29 @@
</view>
<view class="popup-body store-popup" :class="{ 'safe-area': isIphoneX }">
<view class="delivery-content">
<view class="item-wrap" v-for="(item, index) in storeInfo.storeList" :key="index" @click="selectPickupPoint(item)">
<view class="item-wrap" v-for="(item, index) in storeInfo.storeList" :key="index"
@click="selectPickupPoint(item)">
<view class="detail">
<view class="name" :class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''">
<view class="name"
:class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''">
<text>{{ item.store_name }}</text>
<text v-if="item.distance">({{ item.distance }}km)</text>
</view>
<view class="info">
<view :class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''" class="font-size-goods-tag">
<view
:class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''"
class="font-size-goods-tag">
营业时间{{ item.open_date }}
</view>
<view :class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''" class="font-size-goods-tag">
<view
:class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''"
class="font-size-goods-tag">
地址{{ item.full_address }}{{ item.address }}
</view>
</view>
</view>
<view class="icon" v-if="item.store_id == orderPaymentData.delivery.store_id"><text class="iconfont icon-yuan_checked color-base-text"></text></view>
<view class="icon" v-if="item.store_id == orderPaymentData.delivery.store_id"><text
class="iconfont icon-yuan_checked color-base-text"></text></view>
</view>
<view v-if="!storeInfo.storeList" class="empty">所选择收货地址附近没有可以自提的门店</view>
</view>
@@ -267,7 +302,8 @@
</scroll-view>
<!-- 选择支付方式弹窗 -->
<ns-payment ref="choosePaymentPopup" :payMoney="orderPaymentData.order_money" @confirm="orderCreate"></ns-payment>
<ns-payment ref="choosePaymentPopup" :payMoney="orderPaymentData.order_money"
@confirm="orderCreate"></ns-payment>
<loading-cover ref="loadingCover"></loading-cover>
@@ -277,38 +313,28 @@
</template>
<script>
import payment from './public/js/payment.js';
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import payment from './public/js/payment.js';
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
mixins: [payment]
};
export default {
mixins: [payment]
};
</script>
<style lang="scss">
@import "@/common/css/order_parment.scss";
@import "@/common/css/order_parment.scss";
</style>
<style lang="scss" scoped>
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup {
z-index: 8;
}
/deep/ .uni-popup {
z-index: 8;
}
</style>

View File

@@ -6,7 +6,8 @@
<ns-adv keyword="NS_ARTICLE" class-name="adv-wrap"></ns-adv>
<view class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
<view class="article-img">
<image class="cover-img" :src="$util.img(item.cover_img)" mode="widthFix" @error="imgError(index)"/>
<image class="cover-img" :src="$util.img(item.cover_img)" mode="widthFix"
@error="imgError(index)" />
</view>
<view class="info-wrap">
<text class="title">{{ item.article_title }}</text>
@@ -33,195 +34,184 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
data() {
return {
list: []
};
},
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
onShow() {
this.setPublicShare();
},
methods: {
getData(mescroll) {
this.$api.sendRequest({
url: '/api/article/page',
data: {
page_size: mescroll.size,
page: mescroll.num
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
this.list = this.list.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail: res => {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
export default {
data() {
return {
list: []
};
},
onShow() {
this.setPublicShare();
},
methods: {
getData(mescroll) {
this.$api.sendRequest({
url: '/api/article/page',
data: {
page_size: mescroll.size,
page: mescroll.num
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
});
},
toDetail(item) {
this.$util.redirectTo('/pages_tool/article/detail', {
article_id: item.article_id
});
},
imgError(index) {
if (this.list[index]) this.list[index].cover_img = this.$util.getDefaultImage().article;
},
// 设置公众号分享
setPublicShare() {
let shareUrl = this.$config.h5Domain + '/pages_tool/article/list';
this.$util.setPublicShare({
title: '文章列表',
desc: '',
link: shareUrl,
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) : ''
});
}
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
this.list = this.list.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail: res => {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
onShareAppMessage(res) {
var title = '文章列表';
var path = '/pages_tool/article/list';
return {
title: title,
path: path,
success: res => {},
fail: res => {}
};
toDetail(item) {
this.$util.redirectTo('/pages_tool/article/detail', {
article_id: item.article_id
});
},
//分享到朋友圈
onShareTimeline() {
var title = '文章列表';
var query = '/pages_tool/article/list';
return {
title: title,
query: query,
imageUrl: ''
};
imgError(index) {
if (this.list[index]) this.list[index].cover_img = this.$util.getDefaultImage().article;
},
// 设置公众号分享
setPublicShare() {
let shareUrl = this.$config.h5Domain + '/pages_tool/article/list';
this.$util.setPublicShare({
title: '文章列表',
desc: '',
link: shareUrl,
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) : ''
});
}
};
},
onShareAppMessage(res) {
var title = '文章列表';
var path = '/pages_tool/article/list';
return {
title: title,
path: path,
success: res => { },
fail: res => { }
};
},
//分享到朋友圈
onShareTimeline() {
var title = '文章列表';
var query = '/pages_tool/article/list';
return {
title: title,
query: query,
imageUrl: ''
};
}
};
</script>
<style lang="scss" scoped>
/deep/ .fixed {
position: relative;
top: 0;
/deep/ .fixed {
position: relative;
top: 0;
}
.empty-wrap {
padding-top: 200rpx;
}
.article-wrap {
background: #f8f8f8;
.adv-wrap {
margin: 24rpx 24rpx 0 24rpx;
width: auto;
}
.empty-wrap {
padding-top: 200rpx;
}
.item {
display: flex;
padding: 20rpx;
background-color: #fff;
margin: 24rpx;
border-radius: 16rpx;
.article-wrap {
background: #f8f8f8;
.article-img {
margin-right: 20rpx;
width: 160rpx;
height: 160rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
.adv-wrap {
margin: 24rpx 24rpx 0 24rpx;
width: auto;
image {
width: 100%;
}
}
.item {
.info-wrap {
flex: 1;
display: flex;
padding: 20rpx;
background-color: #fff;
margin: 24rpx;
border-radius: 16rpx;
flex-direction: column;
justify-content: space-between;
.article-img {
margin-right: 20rpx;
width: 160rpx;
height: 160rpx;
.title {
font-weight: bold;
margin-bottom: 10rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
image {
width: 100%;
}
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 30rpx;
line-height: 1.5;
}
.info-wrap {
flex: 1;
.abstract {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: $font-size-tag;
}
.read-wrap {
display: flex;
flex-direction: column;
justify-content: space-between;
color: #999ca7;
justify-content: flex-start;
align-items: center;
margin-top: 10rpx;
line-height: 1;
.title {
font-weight: bold;
margin-bottom: 10rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
font-size: 30rpx;
line-height: 1.5;
}
.abstract {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text {
font-size: $font-size-tag;
}
.read-wrap {
display: flex;
color: #999ca7;
justify-content: flex-start;
align-items: center;
margin-top: 10rpx;
line-height: 1;
.iconfont {
font-size: 36rpx;
vertical-align: bottom;
margin-right: 10rpx;
}
text {
font-size: $font-size-tag;
}
.category-icon {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: $base-color;
margin-right: 10rpx;
}
.iconfont {
font-size: 36rpx;
vertical-align: bottom;
margin-right: 10rpx;
}
.category-icon {
width: 8rpx;
height: 8rpx;
border-radius: 50%;
background: $base-color;
margin-right: 10rpx;
}
.date {
margin-left: 20rpx;
}
.date {
margin-left: 20rpx;
}
}
}
}
}
</style>

View File

@@ -2,41 +2,23 @@
<view>
<view class="search-wrap uni-flex uni-row">
<view class="flex-item input-wrap">
<input
class="uni-input"
maxlength="50"
placeholder="请输入您要搜索的文件名称"
v-model="keyword"
@confirm="search"
@input="__set_model($event, 'keyword')"
/>
<input class="uni-input" maxlength="50" placeholder="请输入您要搜索的文件名称" v-model="keyword" @confirm="search"
@input="__set_model($event, 'keyword')" />
<text class="iconfont icon-sousuo3" @tap="search"></text>
</view>
</view>
<mescroll-uni
ref="mescroll"
top="100"
@getData="getData"
>
<mescroll-uni ref="mescroll" top="100" @getData="getData">
<view slot="list">
<block v-if="list.length > 0">
<view class="article-wrap">
<ns-adv
keyword="NS_ARTICLE"
class-name="adv-wrap"
></ns-adv>
<ns-adv keyword="NS_ARTICLE" class-name="adv-wrap"></ns-adv>
<block v-for="(item, index) in list" :key="index">
<view class="item" @tap="toDetail(item.$orig)">
<view class="article-img">
<image
class="cover-img"
:src="item.g1"
mode="widthFix"
@error="imgError(index)"
></image>
<image class="cover-img" :src="item.g1" mode="widthFix" @error="imgError(index)"></image>
</view>
<view class="info-wrap">
<view class="title">{{item.$orig.files_title}}</view>
<view class="title">{{ item.$orig.files_title }}</view>
<view class="read-wrap">
<text>查看PDF文件</text>
</view>
@@ -58,227 +40,231 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup,
// #endif
export default {
data() {
return {
category_id: '',
list: [],
title: '',
keyword: ''
}
},
onLoad(options) {
if (options.category_id > 0) {
this.category_id = options.category_id
}
},
onShow() {
},
methods: {
__set_model(event, field) {
this[field] = event.detail.value
},
data() {
return {
category_id: '',
list: [],
title: '',
keyword: ''
}
search() {
this.list = []
this.$refs.mescroll.refresh()
},
onLoad(options) {
if (options.category_id > 0) {
this.category_id = options.category_id
}
},
onShow() {
},
methods: {
__set_model(event, field) {
this[field] = event.detail.value
},
search() {
this.list = []
this.$refs.mescroll.refresh()
},
getData(page) {
this.$api.sendRequest({
url: '/api/files/getpage',
data: {
page_size: page.size,
page: page.num,
category_id: this.category_id,
keyword: this.keyword
},
success: res => {
let list = []
let message = res.message
if (res.code === 0 && res.data) {
list = res.data.list
if (!this.title && res.data.list.length > 0) {
uni.setNavigationBarTitle({
title: res.data.list[0].category_name
})
}
} else {
this.$util.showToast({
title: message
getData(page) {
this.$api.sendRequest({
url: '/api/files/getpage',
data: {
page_size: page.size,
page: page.num,
category_id: this.category_id,
keyword: this.keyword
},
success: res => {
let list = []
let message = res.message
if (res.code === 0 && res.data) {
list = res.data.list
if (!this.title && res.data.list.length > 0) {
uni.setNavigationBarTitle({
title: res.data.list[0].category_name
})
}
page.endSuccess(list.length)
if (page.num === 1) {
this.list = []
}
this.list = this.list.concat(list.map(item => {
const orig = item
const g1 = this.$util.img("addon/personnel/shop/view/enterprise/fileicon.png")
return { $orig: orig, g1: g1 }
}))
if (this.$refs.loadingCover) {
this.$refs.loadingCover.hide()
} else {
this.$util.showToast({
title: message
})
}
page.endSuccess(list.length)
if (page.num === 1) {
this.list = []
}
this.list = this.list.concat(list.map(item => {
const orig = item
const g1 = this.$util.img("addon/personnel/shop/view/enterprise/fileicon.png")
return { $orig: orig, g1: g1 }
}))
if (this.$refs.loadingCover) {
this.$refs.loadingCover.hide()
}
},
fail: () => {
page.endErr()
if (this.$refs.loadingCover) {
this.$refs.loadingCover.hide()
}
}
})
},
toDetail(item) {
console.log(item.files_url)
uni.showLoading({
title: '正在加载'
})
try {
uni.downloadFile({
url: item.files_url,
success: res => {
console.log(res)
if (res.statusCode === 200) {
uni.openDocument({
filePath: res.tempFilePath,
success: () => {
console.log('打开成功')
},
fail: () => {
},
complete: () => {
uni.hideLoading()
}
})
}
},
fail: () => {
page.endErr()
if (this.$refs.loadingCover) {
this.$refs.loadingCover.hide()
uni.hideLoading()
},
complete: res => {
console.log('下载完成', res)
if (res.statusCode === 404) {
uni.showToast({
title: '文件不存在',
icon: 'none'
})
}
}
})
},
toDetail(item) {
console.log(item.files_url)
uni.showLoading({
title: '正在加载'
})
try {
uni.downloadFile({
url: item.files_url,
success: res => {
console.log(res)
if (res.statusCode === 200) {
uni.openDocument({
filePath: res.tempFilePath,
success: () => {
console.log('打开成功')
},
fail: () => {
},
complete: () => {
uni.hideLoading()
}
})
}
},
fail: () => {
uni.hideLoading()
},
complete: res => {
console.log('下载完成', res)
if (res.statusCode === 404) {
uni.showToast({
title: '文件不存在',
icon: 'none'
})
}
}
})
} catch (e) {
console.log('CatchClause', e)
uni.hideLoading()
}
},
imgError(index) {
if (this.list[index]) {
this.list[index].cover_img = this.$util.getDefaultImage().article
}
} catch (e) {
console.log('CatchClause', e)
uni.hideLoading()
}
},
imgError(index) {
if (this.list[index]) {
this.list[index].cover_img = this.$util.getDefaultImage().article
}
}
}
}
</script>
<style scoped>
.search-wrap {
flex: 0.5;
padding: 30rpx 30rpx 0;
font-size: 24rpx;
display: flex;
align-items: center;
}
.search-wrap .iconfont {
margin-left: 16rpx;
font-size: 36rpx;
}
.search-wrap .input-wrap {
flex: 1;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
height: 64rpx;
padding-left: 10rpx;
border-radius: 70rpx;
}
.search-wrap .input-wrap input {
width: 90%;
background: #fff;
font-size: 24rpx;
height: 100%;
padding: 0 25rpx 0 40rpx;
line-height: 50rpx;
border-radius: 40rpx;
}
.search-wrap .input-wrap text {
font-size: 32rpx;
color: #909399;
width: 80rpx;
text-align: center;
margin-right: 20rpx;
}
.empty-wrap {
padding-top: 200rpx;
}
.article-wrap {
background: #f8f8f8;
}
.article-wrap .adv-wrap {
margin: 24rpx 24rpx 0 24rpx;
width: auto;
}
.article-wrap .item {
display: flex;
padding: 20rpx;
background-color: #fff;
margin: 24rpx;
border-radius: 16rpx;
}
.article-wrap .item .article-img {
margin-right: 20rpx;
width: 80rpx;
height: 80rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.article-wrap .item .article-img image {
width: 100%;
}
.article-wrap .item .info-wrap {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.article-wrap .item .info-wrap .title {
font-weight: 700;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
font-size: 24rpx;
}
.article-wrap .item .info-wrap .read-wrap {
display: flex;
color: #999ca7;
justify-content: flex-start;
align-items: center;
margin-top: 10rpx;
line-height: 1;
}
.article-wrap .item .info-wrap .read-wrap text {
font-size: 24rpx;
}
.search-wrap {
flex: 0.5;
padding: 30rpx 30rpx 0;
font-size: 24rpx;
display: flex;
align-items: center;
}
.search-wrap .iconfont {
margin-left: 16rpx;
font-size: 36rpx;
}
.search-wrap .input-wrap {
flex: 1;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
height: 64rpx;
padding-left: 10rpx;
border-radius: 70rpx;
}
.search-wrap .input-wrap input {
width: 90%;
background: #fff;
font-size: 24rpx;
height: 100%;
padding: 0 25rpx 0 40rpx;
line-height: 50rpx;
border-radius: 40rpx;
}
.search-wrap .input-wrap text {
font-size: 32rpx;
color: #909399;
width: 80rpx;
text-align: center;
margin-right: 20rpx;
}
.empty-wrap {
padding-top: 200rpx;
}
.article-wrap {
background: #f8f8f8;
}
.article-wrap .adv-wrap {
margin: 24rpx 24rpx 0 24rpx;
width: auto;
}
.article-wrap .item {
display: flex;
padding: 20rpx;
background-color: #fff;
margin: 24rpx;
border-radius: 16rpx;
}
.article-wrap .item .article-img {
margin-right: 20rpx;
width: 80rpx;
height: 80rpx;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.article-wrap .item .article-img image {
width: 100%;
}
.article-wrap .item .info-wrap {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.article-wrap .item .info-wrap .title {
font-weight: 700;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
font-size: 24rpx;
}
.article-wrap .item .info-wrap .read-wrap {
display: flex;
color: #999ca7;
justify-content: flex-start;
align-items: center;
margin-top: 10rpx;
line-height: 1;
}
.article-wrap .item .info-wrap .read-wrap text {
font-size: 24rpx;
}
</style>

View File

@@ -24,104 +24,94 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
export default {
data() {
return {
brandList: [],
siteId: 0
};
},
onLoad(options) {
if (options.site_id) this.siteId = options.site_id;
},
onShow() { },
methods: {
change(e) {
this.$util.redirectTo('/pages_goods/list', {
brand_id: this.brandList[e.detail.index].brand_id
});
},
data() {
return {
brandList: [],
siteId: 0
};
},
onLoad(options) {
if (options.site_id) this.siteId = options.site_id;
},
onShow() {},
methods: {
change(e) {
this.$util.redirectTo('/pages_goods/list', {
brand_id: this.brandList[e.detail.index].brand_id
});
},
getBrandList(mescroll) {
this.$api.sendRequest({
url: '/api/goodsbrand/page',
data: {
page_size: mescroll.size,
page: mescroll.num,
site_id: this.siteId
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) this.brandList = []; //如果是第一页需手动制空列表
this.brandList = this.brandList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
getBrandList(mescroll) {
this.$api.sendRequest({
url: '/api/goodsbrand/page',
data: {
page_size: mescroll.size,
page: mescroll.num,
site_id: this.siteId
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
});
}
},
onShareAppMessage(res) {
var title = '你想要的大牌都在这里';
var path = '/pages_tool/goods/brand';
return {
title: title,
path: path,
success: res => {},
fail: res => {}
};
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) this.brandList = []; //如果是第一页需手动制空列表
this.brandList = this.brandList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
}
};
},
onShareAppMessage(res) {
var title = '你想要的大牌都在这里';
var path = '/pages_tool/goods/brand';
return {
title: title,
path: path,
success: res => { },
fail: res => { }
};
}
};
</script>
<style lang="scss">
/deep/ .uni-grid-item {
width: calc((100vw - (#{$margin-both} * 2)) / 3) !important;
/deep/ .uni-grid-item {
width: calc((100vw - (#{$margin-both} * 2)) / 3) !important;
}
.adv-wrap {
margin: $margin-updown $margin-both;
width: auto;
}
.brand-content {
padding: $padding 0;
box-sizing: border-box;
background: #ffffff;
margin: $margin-updown $margin-both 0;
.brand-pic {
width: 60%;
height: 50%;
}
.adv-wrap {
margin: $margin-updown $margin-both;
width: auto;
}
.brand-content {
padding: $padding 0;
box-sizing: border-box;
background: #ffffff;
margin: $margin-updown $margin-both 0;
.brand-pic {
width: 60%;
height: 50%;
}
.brand_name {
width: 70%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
}
.brand_name {
width: 70%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
}
}
</style>

View File

@@ -2,42 +2,53 @@
<view :style="themeColor">
<view class="cf-container color-line-border">
<view class="tab">
<view @click="changeSort(1)"><text :class="sort == 1 ? 'color-base-text active color-base-border-bottom' : ''">全部</text></view>
<view @click="changeSort(2, 'reward')"><text :class="sort == 2 ? 'color-base-text active color-base-border-bottom' : ''">满减券</text></view>
<view @click="changeSort(3, 'discount')"><text :class="sort == 3 ? 'color-base-text active color-base-border-bottom' : ''">折扣券</text></view>
<!-- <view @click="changeSort(4, 'no_threshold')"><text :class="sort == 4 ? 'color-base-text active color-base-border-bottom' : ''">无门槛</text></view> -->
<view @click="changeSort(1)"><text
:class="sort == 1 ? 'color-base-text active color-base-border-bottom' : ''">全部</text></view>
<view @click="changeSort(2, 'reward')"><text
:class="sort == 2 ? 'color-base-text active color-base-border-bottom' : ''">满减</text></view>
<view @click="changeSort(3, 'discount')"><text
:class="sort == 3 ? 'color-base-text active color-base-border-bottom' : ''">折扣券</text></view>
<!-- <view @click="changeSort(4, 'no_threshold')"><text :class="sort == 4 ? 'color-base-text active color-base-border-bottom' : ''">无门槛券</text></view> -->
</view>
</view>
<mescroll-uni ref="mescroll" top="100" @getData="getMemberCouponList">
<block slot="list">
<view class="coupon-listone">
<view class="item" v-for="(item, index) in list" :key="index" @click="liClick(item, index)" :style="{ backgroundColor: item.useState == 2 ? '#F2F2F2' : 'var(--main-color-shallow)' }">
<view class="item" v-for="(item, index) in list" :key="index" @click="liClick(item, index)"
:style="{ backgroundColor: item.useState == 2 ? '#F2F2F2' : 'var(--main-color-shallow)' }">
<view class="item-base" :class="{ disabled: item.useState == 2 }">
<image class="coupon-line" mode="heightFix" :src="$util.img('public/uniapp/coupon/coupon_line.png')"></image>
<image class="coupon-line" mode="heightFix"
:src="$util.img('public/uniapp/coupon/coupon_line.png')"></image>
<view>
<view class="use_price price-font" v-if="item.type == 'reward'" :class="{ disabled: item.useState == 2 }">
<view class="use_price price-font" v-if="item.type == 'reward'"
:class="{ disabled: item.useState == 2 }">
<text></text>
{{ parseFloat(item.money) }}
</view>
<view class="use_price price-font" v-else-if="item.type == 'discount'" :class="{ disabled: item.useState == 2 }">
<view class="use_price price-font" v-else-if="item.type == 'discount'"
:class="{ disabled: item.useState == 2 }">
{{ parseFloat(item.discount) }}
<text></text>
</view>
<view class="use_condition font-size-tag" v-if="item.at_least > 0" :class="{ disabled: item.useState == 2 }">{{ item.at_least }}元可用</view>
<view class="use_condition font-size-tag" v-else :class="{ disabled: item.useState == 2 }">无门槛优惠券</view>
<view class="use_condition font-size-tag" v-if="item.at_least > 0"
:class="{ disabled: item.useState == 2 }">{{ item.at_least }}元可用</view>
<view class="use_condition font-size-tag" v-else
:class="{ disabled: item.useState == 2 }">无门槛优惠券</view>
</view>
</view>
<view class="item-info">
<view class="use_title">
<view class="title">{{ item.coupon_name }}</view>
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3" :class="{ disabled: item.useState == 2 }">指定商品</view>
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3"
:class="{ disabled: item.useState == 2 }">指定商品</view>
<view class="max_price" v-else :class="{ disabled: item.useState == 2 }">全场商品</view>
<view class="max_price" v-if="item.discount_limit != '0.00'">
(最大优惠{{ item.discount_limit }})
</view>
<view class="max_price" :class="{ disabled: item.useState == 2 }">{{ item.use_channel_name }}</view>
<!-- <view class="max_price truncate" v-if="item.use_channel!='online'" :class="{ disabled: item.useState == 2 }">
<view class="max_price" :class="{ disabled: item.useState == 2 }">{{
item.use_channel_name }}</view>
<!-- <view class="max_price truncate" v-if="item.use_channel!='online'" :class="{ disabled: item.useState == 2 }">
{{ item.use_store==='all'?'适用门店全部门店': '适用门店'+item.use_store_name}}
</view> -->
</view>
@@ -70,400 +81,391 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
list: [],
sort: 1,
types: '',
couponBtnSwitch: false,
//分享建立上下级id
mpShareData: null //小程序分享数据
};
},
onLoad(option) {
setTimeout( () => {
if (!this.addonIsExist.coupon) {
this.$util.showToast({
title: '商家未开启优惠券',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
},1000);
//小程序分享接收source_member
if (option.source_member) {
uni.setStorageSync('source_member', option.source_member);
}
// 小程序扫码进入接收source_member
if (option.scene) {
var sceneParams = decodeURIComponent(option.scene);
sceneParams = sceneParams.split('&');
if (sceneParams.length) {
sceneParams.forEach(item => {
if (item.indexOf('sku_id') != -1) this.skuId = item.split('-')[1];
if (item.indexOf('m') != -1) uni.setStorageSync('source_member', item.split('-')[1]);
if (item.indexOf('is_test') != -1) uni.setStorageSync('is_test', 1);
});
}
}
},
onShow() {
//记录分享关系
if (this.storeToken && uni.getStorageSync('source_member')) {
this.$util.onSourceMember(uni.getStorageSync('source_member'));
}
//小程序分享
// #ifdef MP-WEIXIN
this.$util.getMpShare().then(res => {
this.mpShareData = res;
});
// #endif
},
//分享给好友
onShareAppMessage() {
return this.mpShareData.appMessage;
},
//分享到朋友圈
onShareTimeline() {
return this.mpShareData.timeLine;
},
methods: {
changeSort(sort, types) {
this.list = [];
this.sort = sort;
this.types = types;
this.$refs.mescroll.refresh(false);
},
liClick(item, index) {
if(['limit', 'expire', 'out'].includes(item.receivedType)) return false;
if (item.useState == 0) this.receiveCoupon(item, index);
else this.toGoodsList(item, index);
},
//领取优惠券
receiveCoupon(item, index) {
if (this.couponBtnSwitch) return;
this.couponBtnSwitch = true;
if (this.storeToken) {
this.$api.sendRequest({
url: '/coupon/api/coupon/receive',
data: {
coupon_type_id: item.coupon_type_id,
get_type: 2 //获取方式:1订单2.直接领取3.活动领取
},
success: res => {
this.couponBtnSwitch = false;
let msg = '领取成功,快去使用吧';
let list = this.list;
if (res.code < 0) msg = res.message;
if (res.data.is_exist == 1) {
for (let i = 0; i < list.length; i++) {
if (list[i].coupon_type_id == item.coupon_type_id) {
list[i].useState = 1;
}
}
} else {
for (let i = 0; i < list.length; i++) {
if (list[i].coupon_type_id == item.coupon_type_id) {
list[i].receivedType = res.data.type;
list[i].useState = 2;
}
}
}
this.$util.showToast({
title: msg
});
},
fail: res => {
this.couponBtnSwitch = false;
}
});
} else {
this.couponBtnSwitch = false;
this.$refs.login.open('/pages_tool/goods/coupon');
}
},
//获取优惠券列表
getMemberCouponList(mescroll) {
this.$api.sendRequest({
url: '/coupon/api/coupon/typepagelists',
data: {
page: mescroll.num,
page_size: mescroll.size,
sort: this.sort,
type: this.types
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
mescroll.endSuccess(newArr.length);
if (newArr.length) {
newArr.forEach(v => {
if (v.count == v.lead_count) v.useState = 2;
else if (v.max_fetch != 0 && v.member_coupon_num && v.member_coupon_num >= v.max_fetch) v.useState = 1;
else v.useState = 0;
});
}
//设置列表数据
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
this.list = this.list.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
export default {
data() {
return {
list: [],
sort: 1,
types: '',
couponBtnSwitch: false,
//分享建立上下级id
mpShareData: null //小程序分享数据
};
},
onLoad(option) {
setTimeout(() => {
if (!this.addonIsExist.coupon) {
this.$util.showToast({
title: '商家未开启优惠券',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
}, 1000);
//小程序分享接收source_member
if (option.source_member) {
uni.setStorageSync('source_member', option.source_member);
}
// 小程序扫码进入接收source_member
if (option.scene) {
var sceneParams = decodeURIComponent(option.scene);
sceneParams = sceneParams.split('&');
if (sceneParams.length) {
sceneParams.forEach(item => {
if (item.indexOf('sku_id') != -1) this.skuId = item.split('-')[1];
if (item.indexOf('m') != -1) uni.setStorageSync('source_member', item.split('-')[1]);
if (item.indexOf('is_test') != -1) uni.setStorageSync('is_test', 1);
});
},
imageError(index) {
this.list[index].logo = this.$util.getDefaultImage().goods;
this.$forceUpdate();
},
couponImageError(index) {
this.list[index].image = this.$util.img('public/uniapp/goods/coupon.png');
this.$forceUpdate();
},
toGoodsList(item) {
if (item.goods_type != 1) {
this.$util.redirectTo('/pages_goods/list', {
coupon: item.coupon_type_id
});
} else {
this.$util.redirectTo('/pages_goods/list', {});
}
}
}
};
},
onShow() {
//记录分享关系
if (this.storeToken && uni.getStorageSync('source_member')) {
this.$util.onSourceMember(uni.getStorageSync('source_member'));
}
//小程序分享
// #ifdef MP-WEIXIN
this.$util.getMpShare().then(res => {
this.mpShareData = res;
});
// #endif
},
//分享给好友
onShareAppMessage() {
return this.mpShareData.appMessage;
},
//分享到朋友圈
onShareTimeline() {
return this.mpShareData.timeLine;
},
methods: {
changeSort(sort, types) {
this.list = [];
this.sort = sort;
this.types = types;
this.$refs.mescroll.refresh(false);
},
liClick(item, index) {
if (['limit', 'expire', 'out'].includes(item.receivedType)) return false;
if (item.useState == 0) this.receiveCoupon(item, index);
else this.toGoodsList(item, index);
},
//领取优惠券
receiveCoupon(item, index) {
if (this.couponBtnSwitch) return;
this.couponBtnSwitch = true;
if (this.storeToken) {
this.$api.sendRequest({
url: '/coupon/api/coupon/receive',
data: {
coupon_type_id: item.coupon_type_id,
get_type: 2 //获取方式:1订单2.直接领取3.活动领取
},
success: res => {
this.couponBtnSwitch = false;
let msg = '领取成功,快去使用吧';
let list = this.list;
if (res.code < 0) msg = res.message;
if (res.data.is_exist == 1) {
for (let i = 0; i < list.length; i++) {
if (list[i].coupon_type_id == item.coupon_type_id) {
list[i].useState = 1;
}
}
} else {
for (let i = 0; i < list.length; i++) {
if (list[i].coupon_type_id == item.coupon_type_id) {
list[i].receivedType = res.data.type;
list[i].useState = 2;
}
}
}
this.$util.showToast({
title: msg
});
},
fail: res => {
this.couponBtnSwitch = false;
}
});
} else {
this.couponBtnSwitch = false;
this.$refs.login.open('/pages_tool/goods/coupon');
}
},
//获取优惠券列表
getMemberCouponList(mescroll) {
this.$api.sendRequest({
url: '/coupon/api/coupon/typepagelists',
data: {
page: mescroll.num,
page_size: mescroll.size,
sort: this.sort,
type: this.types
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
mescroll.endSuccess(newArr.length);
if (newArr.length) {
newArr.forEach(v => {
if (v.count == v.lead_count) v.useState = 2;
else if (v.max_fetch != 0 && v.member_coupon_num && v.member_coupon_num >= v.max_fetch) v.useState = 1;
else v.useState = 0;
});
}
//设置列表数据
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
this.list = this.list.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
imageError(index) {
this.list[index].logo = this.$util.getDefaultImage().goods;
this.$forceUpdate();
},
couponImageError(index) {
this.list[index].image = this.$util.img('public/uniapp/goods/coupon.png');
this.$forceUpdate();
},
toGoodsList(item) {
if (item.goods_type != 1) {
this.$util.redirectTo('/pages_goods/list', {
coupon: item.coupon_type_id
});
} else {
this.$util.redirectTo('/pages_goods/list', {});
}
}
}
};
</script>
<style lang="scss">
.coupon-head {
padding: 20rpx 50rpx;
display: flex;
background: #fff;
.coupon-head {
padding: 20rpx 50rpx;
display: flex;
background: #fff;
.sort {
border: 2rpx solid #c5c5c5;
padding: 1rpx 20rpx;
border-radius: $border-radius;
cursor: pointer;
margin-right: 15rpx;
}
.sort {
border: 2rpx solid #c5c5c5;
padding: 1rpx 20rpx;
border-radius: $border-radius;
cursor: pointer;
margin-right: 15rpx;
}
}
.coupon-listone {
padding: 0 30rpx;
.coupon-listone {
padding: 0 30rpx;
.item {
display: flex;
background-color: #fff2f0;
.item {
display: flex;
background-color: #fff2f0;
background-size: 100% 100%;
border-radius: 20rpx;
align-items: stretch;
margin-top: $padding;
overflow: hidden;
.item-base {
position: relative;
width: 197rpx;
min-width: 197rpx;
text-align: center;
background: linear-gradient(to left, var(--bg-color), var(--bg-color-shallow));
background-repeat: no-repeat;
background-size: 100% 100%;
border-radius: 20rpx;
align-items: stretch;
margin-top: $padding;
overflow: hidden;
padding: 38rpx 10rpx 38rpx 18rpx;
.item-base {
&.disabled {
background: #dedede;
}
.coupon-line {
position: absolute;
right: 0;
top: 0;
height: 100%;
}
>view {
height: auto;
position: relative;
width: 197rpx;
min-width: 197rpx;
text-align: center;
background: linear-gradient(to left, var(--bg-color), var(--bg-color-shallow));
background-repeat: no-repeat;
background-size: 100% 100%;
padding: 38rpx 10rpx 38rpx 18rpx;
top: 50%;
transform: translate(0, -50%);
}
.use_price {
font-size: 60rpx;
line-height: 1;
color: #fff;
text {
font-size: $font-size-toolbar;
}
&.disabled {
background: #dedede;
}
.coupon-line {
position: absolute;
right: 0;
top: 0;
height: 100%;
}
>view {
height: auto;
position: relative;
top: 50%;
transform: translate(0, -50%);
}
.use_price {
font-size: 60rpx;
line-height: 1;
color: #fff;
text {
font-size: $font-size-toolbar;
}
&.disabled {
color: $color-tip;
}
}
.use_condition {
color: #fff;
margin-top: $padding;
&.margin_top_none {
margin-top: 0;
}
&.disabled {
color: $color-tip;
}
}
&::after {
position: absolute;
content: '';
background-color: #f8f8f8;
left: 0;
top: 50%;
transform: translate(0, -50%);
height: 30rpx;
width: 15rpx;
border-radius: 0 30rpx 30rpx 0;
color: $color-tip;
}
}
.item-btn {
width: 160rpx;
min-width: 160rpx;
align-self: center;
position: relative;
.use_condition {
color: #fff;
margin-top: $padding;
view {
width: 100rpx;
height: 50rpx;
border-radius: $border-radius;
line-height: 50rpx;
margin: auto;
text-align: center;
background-image: linear-gradient(to right, var(--bg-color), var(--bg-color-shallow));
color: var(--btn-text-color);
&.margin_top_none {
margin-top: 0;
}
&.disabled {
color: $color-tip;
}
}
&::after {
position: absolute;
content: '';
background-color: #f8f8f8;
left: 0;
top: 50%;
transform: translate(0, -50%);
height: 30rpx;
width: 15rpx;
border-radius: 0 30rpx 30rpx 0;
}
}
.item-btn {
width: 160rpx;
min-width: 160rpx;
align-self: center;
position: relative;
view {
width: 100rpx;
height: 50rpx;
border-radius: $border-radius;
line-height: 50rpx;
margin: auto;
text-align: center;
background-image: linear-gradient(to right, var(--bg-color), var(--bg-color-shallow));
color: var(--btn-text-color);
font-size: $font-size-tag;
&.disabled {
background: #dedede !important;
color: #909399 !important;
}
}
&::after {
position: absolute;
content: '';
background-color: #f8f8f8;
right: 0;
top: 50%;
transform: translate(0, -50%);
height: 30rpx;
width: 15rpx;
border-radius: 30rpx 0 0 30rpx;
}
}
.item-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-left: 20rpx;
overflow: hidden;
background-repeat-x: no-repeat;
background-repeat-y: repeat;
.use_time {
padding: 20rpx 0;
border-top: 2rpx dashed #cccccc;
font-size: $font-size-activity-tag;
color: #909399;
}
.use_title {
font-size: $font-size-base;
font-weight: 500;
padding: 20rpx 0;
// height:80rpx;
.title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.max_price {
font-weight: 400;
font-size: $font-size-tag;
&.disabled {
background: #dedede !important;
color: #909399 !important;
}
}
&::after {
position: absolute;
content: '';
background-color: #f8f8f8;
right: 0;
top: 50%;
transform: translate(0, -50%);
height: 30rpx;
width: 15rpx;
border-radius: 30rpx 0 0 30rpx;
}
}
.item-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-left: 20rpx;
overflow: hidden;
background-repeat-x: no-repeat;
background-repeat-y: repeat;
.use_time {
padding: 20rpx 0;
border-top: 2rpx dashed #cccccc;
font-size: $font-size-activity-tag;
color: #909399;
}
.use_title {
font-size: $font-size-base;
font-weight: 500;
padding: 20rpx 0;
// height:80rpx;
.title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.max_price {
font-weight: 400;
font-size: $font-size-tag;
}
}
}
}
}
}
.empty {
margin-top: 200rpx;
}
.empty {
margin-top: 200rpx;
}
.cf-container {
background: #fff;
overflow: hidden;
}
.cf-container {
background: #fff;
overflow: hidden;
}
.tab {
display: flex;
justify-content: space-between;
.tab {
display: flex;
justify-content: space-between;
height: 86rpx;
>view {
text-align: center;
width: 33%;
height: 86rpx;
>view {
text-align: center;
width: 33%;
height: 86rpx;
text {
display: inline-block;
line-height: 86rpx;
height: 80rpx;
font-size: 30rpx;
}
text {
display: inline-block;
line-height: 86rpx;
height: 80rpx;
font-size: 30rpx;
}
}
}
.active {
border-bottom: 4rpx solid;
}
.truncate {
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
}
.active {
border-bottom: 4rpx solid;
}
.truncate {
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>

View File

@@ -74,19 +74,7 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
goodsId: 0,

View File

@@ -67,18 +67,7 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
dataList: [], //账号列表

View File

@@ -100,18 +100,8 @@
import {
Weixin
} from 'common/js/wx-jssdk.js';
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
addressList: [],

View File

@@ -5,7 +5,7 @@
<text class="uni-tab-item-title" :class="statusIndex == orderStatus ? 'uni-tab-item-title-active' : ''">{{ statusItem.name }}</text>
</view>
</scroll-view> -->
<!-- <view class="tab color-bg">
<!-- <view class="tab color-bg">
<view class="tab-left">
<picker mode="date" :value="searchType.date" @change="bindDateChange" fields="month">
<view class="uni-input">
@@ -27,15 +27,18 @@
<block v-if="dataList.length > 0">
<view class="detailed-wrap">
<view class="balances" v-for="(item, index) in dataList" :key="index">
<image :src="$util.img('public/uniapp/balance/recharge.png')" class="balances-img" v-if="item.account_data > 0"></image>
<image v-else :src="$util.img('public/uniapp/balance/shopping.png')" mode="widthFix"></image>
<image :src="$util.img('public/uniapp/balance/recharge.png')" class="balances-img"
v-if="item.account_data > 0"></image>
<image v-else :src="$util.img('public/uniapp/balance/shopping.png')" mode="widthFix">
</image>
<view class="balances-info" @click="toFromDetail(item)">
<text class="title">{{ item.remark }}</text>
<!-- <text>{{ item.remark }}</text> -->
<!-- <text>{{ item.remark }}</text> -->
<text>{{ $util.timeStampTurnTime(item.create_time) }}</text>
</view>
<view class="balances-num">
<text :class="item.account_data > 0 ? 'color-base-text' : ''">{{ item.account_data > 0 ? '+' + item.account_data : item.account_data }}</text>
<text :class="item.account_data > 0 ? 'color-base-text' : ''">{{ item.account_data > 0 ?
'+' + item.account_data : item.account_data }}</text>
</view>
</view>
</view>
@@ -51,318 +54,309 @@
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
data() {
const currentDate = this.getDate({
format: true
});
return {
dataList: [],
statusList: [{
name: '全部',
id: '0'
}, {
name: '收入',
id: '1'
}, {
name: '支出',
id: '2'
}],
scrollInto: '',
orderStatus: '0',
date: currentDate,
searchType: {
from_type: 0,
date: ''
},
balanceType: [{
label: '全部',
value: '0'
}], //积分类型
balanceIndex: 0,
related_id: 0
};
},
data() {
const currentDate = this.getDate({
format: true
onLoad(option) {
if (option.group_id) this.related_id = option.group_id ? option.group_id : 0;
if (option.from_type) this.searchType.from_type = option.from_type;
if (option.related_id) this.related_id = option.related_id ? option.related_id : 0;
if (option.status) this.orderStatus = option.status;
this.getbalanceType();
},
onShow() {
if (!this.storeToken) {
this.$nextTick(() => {
this.$refs.login.open('/pages_tool/member/balance');
});
return {
dataList: [],
statusList: [{
name: '全部',
id: '0'
}, {
name: '收入',
id: '1'
}, {
name: '支出',
id: '2'
}],
scrollInto: '',
orderStatus: '0',
date: currentDate,
searchType: {
from_type: 0,
date: ''
},
balanceType: [{
label: '全部',
value: '0'
}], //积分类型
balanceIndex: 0,
related_id: 0
};
}
},
methods: {
bindDateChange: function (e) {
var temp = e.target.value;
var tempArr = temp.split('-');
this.date = tempArr[0] + '年' + tempArr[1] + '';
this.searchType.date = e.target.value;
this.$refs.mescroll.refresh();
},
onLoad(option) {
if (option.group_id) this.related_id = option.group_id ? option.group_id : 0;
if (option.from_type) this.searchType.from_type = option.from_type;
if (option.related_id) this.related_id = option.related_id ? option.related_id : 0;
if (option.status) this.orderStatus = option.status;
this.getbalanceType();
},
onShow() {
if (!this.storeToken) {
this.$nextTick(() => {
this.$refs.login.open('/pages_tool/member/balance');
});
}
},
methods: {
bindDateChange: function(e) {
var temp = e.target.value;
var tempArr = temp.split('-');
this.date = tempArr[0] + '年' + tempArr[1] + '月';
this.searchType.date = e.target.value;
this.$refs.mescroll.refresh();
},
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}${month}`;
},
bindPickerChange(e) {
this.balanceIndex = e.detail.value;
this.searchType.from_type = this.balanceType[this.balanceIndex].value;
this.$refs.mescroll.refresh();
},
//获取分类类型
getbalanceType() {
this.$api.sendRequest({
url: '/api/memberaccount/fromType',
success: res => {
let balanceType = Object.assign(res.balance, res.balance_money),
typeArr = [{
label: '全部',
value: '0'
}];
for (var index in balanceType) {
typeArr.push({
label: balanceType[index].type_name,
value: index
})
}
this.balanceType = typeArr;
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}${month}`;
},
bindPickerChange(e) {
this.balanceIndex = e.detail.value;
this.searchType.from_type = this.balanceType[this.balanceIndex].value;
this.$refs.mescroll.refresh();
},
//获取分类类型
getbalanceType() {
this.$api.sendRequest({
url: '/api/memberaccount/fromType',
success: res => {
let balanceType = Object.assign(res.balance, res.balance_money),
typeArr = [{
label: '全部',
value: '0'
}];
for (var index in balanceType) {
typeArr.push({
label: balanceType[index].type_name,
value: index
})
}
});
},
ontabtap(e) {
let index = e.currentTarget.dataset.current;
this.orderStatus = this.statusList[index].id;
this.$refs.mescroll.refresh();
},
getData(mescroll) {
this.$api.sendRequest({
url: '/api/memberaccount/page',
data: {
page_size: mescroll.size,
page: mescroll.num,
account_type: 'balance,balance_money',
from_type: this.searchType.from_type,
date: this.searchType.date,
related_id: this.related_id
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) {
this.dataList = []; //如果是第一页需手动制空列表
this.related_id = 0;
}
this.dataList = this.dataList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail: res => {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
toFromDetail(item) {
if (item.from_type == 'order' && !isNaN(parseInt(item.type_tag))) {
this.$util.redirectTo('/pages_order/detail', {
order_id: item.type_tag
});
} else if (item.from_type == 'refund' && parseInt(item.type_tag) != 0) {
this.$util.redirectTo('/pages_order/detail', {
order_id: item.type_tag
});
this.balanceType = typeArr;
}
});
},
ontabtap(e) {
let index = e.currentTarget.dataset.current;
this.orderStatus = this.statusList[index].id;
this.$refs.mescroll.refresh();
},
getData(mescroll) {
this.$api.sendRequest({
url: '/api/memberaccount/page',
data: {
page_size: mescroll.size,
page: mescroll.num,
account_type: 'balance,balance_money',
from_type: this.searchType.from_type,
date: this.searchType.date,
related_id: this.related_id
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
mescroll.endSuccess(newArr.length);
//设置列表数据
if (mescroll.num == 1) {
this.dataList = []; //如果是第一页需手动制空列表
this.related_id = 0;
}
this.dataList = this.dataList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail: res => {
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
toFromDetail(item) {
if (item.from_type == 'order' && !isNaN(parseInt(item.type_tag))) {
this.$util.redirectTo('/pages_order/detail', {
order_id: item.type_tag
});
} else if (item.from_type == 'refund' && parseInt(item.type_tag) != 0) {
this.$util.redirectTo('/pages_order/detail', {
order_id: item.type_tag
});
}
}
};
}
};
</script>
<style lang="scss">
.detailed-wrap {
padding-top: 20rpx;
.detailed-wrap {
padding-top: 20rpx;
margin: 24rpx;
}
margin: 24rpx;
}
.tab {
position: fixed;
top: 0;
width: 100%;
z-index: 10;
display: flex;
justify-content: space-between;
height: 80rpx;
background-color: $color-bg;
.tab {
position: fixed;
top: 0;
width: 100%;
z-index: 10;
display: flex;
justify-content: space-between;
height: 80rpx;
background-color: $color-bg;
view {
flex: 1;
text-align: center;
line-height: 80rpx;
view {
flex: 1;
text-align: center;
line-height: 80rpx;
text {
margin-left: 10rpx;
font-size: $font-size-base;
}
}
.tab-left {
display: flex;
padding-left: 46rpx;
}
.tab-right {
display: flex;
justify-content: flex-end;
padding-right: 26rpx;
text {
margin-left: 10rpx;
font-size: $font-size-base;
}
}
.order-nav {
width: 100vw;
height: 70rpx;
.tab-left {
display: flex;
flex-direction: row;
padding-left: 46rpx;
}
.tab-right {
display: flex;
justify-content: flex-end;
padding-right: 26rpx;
}
}
.order-nav {
width: 100vw;
height: 70rpx;
display: flex;
flex-direction: row;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
background: #fff;
border-bottom-left-radius: 24rpx;
border-bottom-right-radius: 24rpx;
padding-bottom: 30rpx;
position: fixed;
left: 0;
z-index: 998;
.uni-tab-item {
width: 33.33%;
text-align: center;
/* #ifndef APP-PLUS */
display: inline-block;
/* #endif */
flex-wrap: nowrap;
}
.uni-tab-item-title {
color: #555;
font-size: $font-size-base;
display: block;
height: 64rpx;
line-height: 64rpx;
border-bottom: 4rpx solid #fff;
padding: 0 10rpx;
flex-wrap: nowrap;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
background: #fff;
border-bottom-left-radius: 24rpx;
border-bottom-right-radius: 24rpx;
padding-bottom: 30rpx;
position: fixed;
left: 0;
z-index: 998;
.uni-tab-item {
width: 33.33%;
text-align: center;
/* #ifndef APP-PLUS */
display: inline-block;
/* #endif */
flex-wrap: nowrap;
}
.uni-tab-item-title {
color: #555;
font-size: $font-size-base;
display: block;
height: 64rpx;
line-height: 64rpx;
border-bottom: 4rpx solid #fff;
padding: 0 10rpx;
flex-wrap: nowrap;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
}
.uni-tab-item-title-active {
display: block;
height: 64rpx;
padding: 0 10rpx;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
}
.balances {
padding: $margin-both 24rpx;
// margin: 0 $margin-both;
box-sizing: border-box;
display: flex;
align-items: flex-start;
border-bottom: 2rpx solid $color-line;
background: #fff;
margin-bottom: 20rpx;
border-radius: 24rpx;
image {
width: 54rpx;
height: 54rpx;
border-radius: 50%;
padding-top: 10rpx;
}
.balances-info {
flex: 1;
margin-left: 16rpx;
display: flex;
flex-direction: column;
text {
font-size: $font-size-toolbar;
line-height: 1;
&:last-child {}
&:nth-child(2) {
margin-top: $margin-updown;
font-size: $font-size-activity-tag;
color: $color-tip;
}
&:nth-child(3) {
font-size: $font-size-activity-tag;
margin-top: $margin-updown;
color: $color-tip;
}
}
}
.balances-num {
text {
line-height: 1;
font-size: $font-size-toolbar;
font-weight: 500;
color:#09c15f;
font-weight: 700;
}
}
.uni-tab-item-title-active {
display: block;
height: 64rpx;
padding: 0 10rpx;
}
.empty {
width: 100%;
height: 500rpx;
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
}
.balances {
padding: $margin-both 24rpx;
// margin: 0 $margin-both;
box-sizing: border-box;
display: flex;
align-items: flex-start;
border-bottom: 2rpx solid $color-line;
background: #fff;
margin-bottom: 20rpx;
border-radius: 24rpx;
image {
width: 54rpx;
height: 54rpx;
border-radius: 50%;
padding-top: 10rpx;
}
.balances-info {
flex: 1;
margin-left: 16rpx;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
text {
font-size: $font-size-toolbar;
line-height: 1;
&:last-child {}
&:nth-child(2) {
margin-top: $margin-updown;
font-size: $font-size-activity-tag;
color: $color-tip;
}
&:nth-child(3) {
font-size: $font-size-activity-tag;
margin-top: $margin-updown;
color: $color-tip;
}
}
}
.balances-num {
text {
line-height: 1;
font-size: $font-size-toolbar;
font-weight: 500;
color: #09c15f;
font-weight: 700;
}
}
}
.empty {
width: 100%;
height: 500rpx;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
</style>

View File

@@ -1,19 +1,24 @@
<template>
<view :style="themeColor">
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8" @listenRefresh="listenRefresh" v-if="storeToken">
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8" @listenRefresh="listenRefresh"
v-if="storeToken">
<view class="goods_list" slot="list">
<block v-if="collectionList.length > 0">
<view class="goods_li margin-top" v-for="(item, index) in collectionList" :key="index" @click.stop="toDetail(item)">
<view class="goods_li margin-top" v-for="(item, index) in collectionList" :key="index"
@click.stop="toDetail(item)">
<view class="pic">
<image :src="$util.img(item.goods_image.split(',')[0], { size: 'mid' })" mode="aspectFill" @error="goodsImageError(index)"></image>
<image :src="$util.img(item.goods_image.split(',')[0], { size: 'mid' })" mode="aspectFill"
@error="goodsImageError(index)"></image>
</view>
<view class="goods_info">
<view class="goods_name font-size-base">{{ item.sku_name }}</view>
<view class="goods_opection">
<view class="left lineheight-clear ">
<text class="symbol price-style small"></text>
<text class="price price-style large">{{ parseFloat(item.discount_price).toFixed(2).split('.')[0] }}</text>
<text class="symbol price-style small">.{{ parseFloat(item.discount_price).toFixed(2).split('.')[1] }}</text>
<text class="price price-style large">{{
parseFloat(item.discount_price).toFixed(2).split('.')[0] }}</text>
<text class="symbol price-style small">.{{
parseFloat(item.discount_price).toFixed(2).split('.')[1] }}</text>
</view>
<view class="right">
<view class="cars" @click.stop="deleteItem(item.goods_id)">
@@ -36,57 +41,47 @@
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import collection from './public/js/collection.js';
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
mixins: [collection],
data() {
return {};
},
mixins: [collection],
data() {
return {};
},
onShow() {
if (this.storeToken) {
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
} else {
this.$nextTick(() => {
this.$refs.login.open('/pages_tool/member/collection');
});
}
},
watch: {
storeToken: function(nVal, oVal) {
if (nVal) {
this.$refs.mescroll.refresh();
}
onShow() {
if (this.storeToken) {
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
} else {
this.$nextTick(() => {
this.$refs.login.open('/pages_tool/member/collection');
});
}
},
watch: {
storeToken: function (nVal, oVal) {
if (nVal) {
this.$refs.mescroll.refresh();
}
}
};
}
};
</script>
<style lang="scss" scoped>
/deep/ .fixed {
position: relative;
top: 0;
}
/deep/ .fixed {
position: relative;
top: 0;
}
/deep/ .empty {
margin-top: 0 !important;
}
/deep/ .empty {
margin-top: 0 !important;
}
@import './public/css/collection.scss';
@import './public/css/collection.scss';
</style>
<style lang="scss" scoped>
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
<style lang="scss" scoped>
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
</style>

View File

@@ -70,17 +70,8 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
type: '',

View File

@@ -65,18 +65,7 @@
<script>
var dateList = [];
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
goodsList: [],

View File

@@ -45,17 +45,8 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
const currentDate = this.getDate({
format: true

View File

@@ -30,17 +30,8 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
dataList: []

View File

@@ -28,17 +28,7 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
dataList: []

View File

@@ -56,13 +56,8 @@
<script>
import refundMethod from './public/js/refundMethod.js';
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
export default {
components: {
MescrollUni
},
data() {
return {
refundList: [],

View File

@@ -41,12 +41,7 @@
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
export default {
components: {
MescrollUni
},
data() {
return {
orderList: []

View File

@@ -11,16 +11,7 @@
</template>
<script>
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
src: ''

View File

@@ -1,8 +1,24 @@
const { zionUniMpLoadPackagePlugin } = require('zion-uniapp-mp-load-package/webpack');
module.exports = {
productionSourceMap: false,
configureWebpack: config => {
console.log('开始尝试配置极限压缩');
// 配置zion-uniapp-mp-load-package插件
config.plugins.push(new zionUniMpLoadPackagePlugin({
optimization: {
minimize: true,
moduleIds: 'named'
},
packages: [
'pages',
'pages_tool',
'pages_goods',
'pages_order',
'pages_promotion'
]
}));
// 确保minimizer数组存在
if (config.optimization && config.optimization.minimizer && Array.isArray(config.optimization.minimizer)) {
// 查找TerserWebpackPlugin实例而不是依赖索引
@@ -65,6 +81,8 @@ module.exports = {
sourceMap: false // 不生成source map
};
console.log('配置极限压缩完成');
}
}