Compare commits
38 Commits
Author | SHA1 | Date | |
---|---|---|---|
688aee582d | |||
![]() |
1a73b2b6dc | ||
![]() |
ed15ccd8ce | ||
![]() |
f54aa79ade | ||
![]() |
96356bc9e1 | ||
![]() |
31cea76850 | ||
![]() |
d5dca0909a | ||
![]() |
17e2e8ed14 | ||
![]() |
e0cead7127 | ||
![]() |
d410edde86 | ||
![]() |
65a141381e | ||
![]() |
55c4cba147 | ||
29210b6953 | |||
![]() |
3b092814a2 | ||
d5b4b1c9a1 | |||
17f51522a7 | |||
a6c5bde685 | |||
![]() |
f252a59da0 | ||
![]() |
304389778b | ||
![]() |
c58d2e4629 | ||
![]() |
36058e7acd | ||
![]() |
0e407ece6a | ||
![]() |
763e68af20 | ||
![]() |
d95ed4f482 | ||
![]() |
42afabe62f | ||
![]() |
4972fb2884 | ||
![]() |
d7900f8eb1 | ||
![]() |
a0592d25ca | ||
![]() |
8084522158 | ||
![]() |
03b6683aac | ||
![]() |
916fa3fdd0 | ||
![]() |
44c83b30ed | ||
![]() |
3f9d9af62f | ||
![]() |
faa9e290b1 | ||
![]() |
bff1ced9fd | ||
![]() |
3696a06181 | ||
![]() |
a0ee08bf85 | ||
![]() |
d7c7f82ec3 |
14
App.vue
@ -13,6 +13,7 @@
|
|||||||
initEvent
|
initEvent
|
||||||
} from "@/utils/uniMPevent.js";
|
} from "@/utils/uniMPevent.js";
|
||||||
let jpushModule = uni.requireNativePlugin("JG-JPush");
|
let jpushModule = uni.requireNativePlugin("JG-JPush");
|
||||||
|
import uniMP from '@/utils/uniMP.js';
|
||||||
// #endif
|
// #endif
|
||||||
import {
|
import {
|
||||||
checkLogin
|
checkLogin
|
||||||
@ -115,8 +116,7 @@
|
|||||||
let messageID = result.messageID
|
let messageID = result.messageID
|
||||||
let title = result.title
|
let title = result.title
|
||||||
let content = result.content
|
let content = result.content
|
||||||
let extras = result.extras
|
let extras = result.extras.type
|
||||||
|
|
||||||
if (result.extras.type == 'ORDER_CREATE' && result.extras.mp3.length > 0) {
|
if (result.extras.type == 'ORDER_CREATE' && result.extras.mp3.length > 0) {
|
||||||
if (result.extras.mp3[0] == '微信') this.audioTeam.push('/static/audio/wechat.MP3')
|
if (result.extras.mp3[0] == '微信') this.audioTeam.push('/static/audio/wechat.MP3')
|
||||||
if (result.extras.mp3[0] == '支付宝') this.audioTeam.push('/static/audio/pay.MP3')
|
if (result.extras.mp3[0] == '支付宝') this.audioTeam.push('/static/audio/pay.MP3')
|
||||||
@ -147,12 +147,22 @@
|
|||||||
// this.audioTeam.push(result.extras.type);
|
// this.audioTeam.push(result.extras.type);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("收到消息")
|
||||||
|
console.log(result)
|
||||||
// 点击事件
|
// 点击事件
|
||||||
if (notificationEventType == 'notificationOpened') {
|
if (notificationEventType == 'notificationOpened') {
|
||||||
|
if (result.extras.type == 2) {
|
||||||
|
let data = result.extras.group_data
|
||||||
|
data.route = result.extras.route
|
||||||
|
data.type = 2
|
||||||
|
uniMP.loadAppletMP(data)
|
||||||
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: result.extras.route
|
url: result.extras.route
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// jpushModule.addCustomMessageListener(result => {
|
// jpushModule.addCustomMessageListener(result => {
|
||||||
|
24
api/store.js
@ -28,6 +28,11 @@ export function getProductParmas(id, data) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getUnimpInfo() {
|
||||||
|
return request.get('intention/publish');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取店铺推荐商品
|
* 获取店铺推荐商品
|
||||||
* @param int id
|
* @param int id
|
||||||
@ -567,6 +572,17 @@ export function getParmasValue(id) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取参数值列表
|
||||||
|
* @param int id
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export function getIntention(uid) {
|
||||||
|
return request.get(`intention/info/${uid}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 到货通知
|
* 到货通知
|
||||||
*
|
*
|
||||||
@ -669,3 +685,11 @@ export function getVillageInfo(data) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
获取店铺资质
|
||||||
|
*/
|
||||||
|
export function consultApi(data) {
|
||||||
|
return request.post(`service/consult`, data)
|
||||||
|
}
|
18
api/user.js
@ -117,6 +117,17 @@ export function registerForget(data) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一键登录
|
||||||
|
*/
|
||||||
|
export function phonelogin(data) {
|
||||||
|
return request.post("auth/phonelogin", data, {
|
||||||
|
noAuth: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户中心菜单
|
* 获取用户中心菜单
|
||||||
*
|
*
|
||||||
@ -259,6 +270,13 @@ export function extractCash(data) {
|
|||||||
export function getAdminApplyAPI(merId, data) {
|
export function getAdminApplyAPI(merId, data) {
|
||||||
return request.get(`admin/${merId}/apply`, data);
|
return request.get(`admin/${merId}/apply`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新商户
|
||||||
|
*/
|
||||||
|
export function isNewMer(uid, mer_id, data) {
|
||||||
|
return request.post(`auth/guide/${uid}/${mer_id}`, data);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 提现银行/提现最低金额
|
* 提现银行/提现最低金额
|
||||||
*
|
*
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
<view class="right-btn-box event_box">
|
<view class="right-btn-box event_box">
|
||||||
<view class="btn-item"
|
<view class="btn-item"
|
||||||
v-if="evaluate != 2 && item.is_refund ==0 && pay_type!= 10 && status==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0"
|
v-if="evaluate != 2 && item.is_refund ==0 && pay_type!= 10 && status==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0"
|
||||||
@click.stop="refund(item)">申请退款</view>
|
@click.stop="showTips=true,refundItem=item">申请退款</view>
|
||||||
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x
|
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x
|
||||||
{{item.product_num - item.refund_num}}
|
{{item.product_num - item.refund_num}}
|
||||||
</view>
|
</view>
|
||||||
@ -113,7 +113,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="btn-item"
|
<view class="btn-item"
|
||||||
v-if="evaluate != 2 && item.refund_switch==1 && pay_type!= 10 && status==0 && (item.is_refund == 0 && evaluate != 9 && orderData.refund_status || item.refund_num > 0)"
|
v-if="evaluate != 2 && item.refund_switch==1 && pay_type!= 10 && status==0 && (item.is_refund == 0 && evaluate != 9 && orderData.refund_status || item.refund_num > 0)"
|
||||||
@click.stop="refund(item)">申请退款</view>
|
@click.stop="showTips=true,refundItem=item">申请退款</view>
|
||||||
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0'
|
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0'
|
||||||
@click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
@click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
||||||
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
|
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
|
||||||
@ -121,6 +121,22 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<u-overlay :show="showTips">
|
||||||
|
<view class="tips">
|
||||||
|
<view class="" style="font-size: 32rpx;">
|
||||||
|
温馨提示
|
||||||
|
</view>
|
||||||
|
<view class="">
|
||||||
|
下单后1小时内申请退款可极速退款
|
||||||
|
</view>
|
||||||
|
<u-button color="#61D137" text="我知道了" @tap="refund(refundItem)"></u-button>
|
||||||
|
</view>
|
||||||
|
</u-overlay>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -195,6 +211,8 @@
|
|||||||
computed: mapGetters(['viewColor']),
|
computed: mapGetters(['viewColor']),
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showTips: false, //退款提示弹窗
|
||||||
|
refundItem: null,
|
||||||
domain: HTTP_REQUEST_URL,
|
domain: HTTP_REQUEST_URL,
|
||||||
totalNmu: '',
|
totalNmu: '',
|
||||||
isTimePay: false, //是否到支付时间
|
isTimePay: false, //是否到支付时间
|
||||||
@ -245,7 +263,8 @@
|
|||||||
let id = res.data.product_assist_set_id;
|
let id = res.data.product_assist_set_id;
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/activity/assist_detail/index?id=' + id + '&sale_type=' + this.sale_type
|
url: '/pages/activity/assist_detail/index?id=' + id +
|
||||||
|
'&sale_type=' + this.sale_type
|
||||||
});
|
});
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@ -257,6 +276,7 @@
|
|||||||
},
|
},
|
||||||
// 退款
|
// 退款
|
||||||
refund(item) {
|
refund(item) {
|
||||||
|
if (this.showTips) this.showTips = false;
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
openOrderRefundSubscribe().then(() => {
|
openOrderRefundSubscribe().then(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
@ -281,12 +301,14 @@
|
|||||||
if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) {
|
if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual != 0) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' + '&ids=' + item
|
url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' + '&ids=' + item
|
||||||
.order_product_id + '&refund_type=1&order_type=' + this.orderData.order_type + '&sale_type=' + this.sale_type
|
.order_product_id + '&refund_type=1&order_type=' + this.orderData.order_type +
|
||||||
|
'&sale_type=' + this.sale_type
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/refund/select?order_id=' + this.orderId + '&type=1&order_type=' + this
|
url: '/pages/users/refund/select?order_id=' + this.orderId + '&type=1&order_type=' + this
|
||||||
.orderData.order_type + '&ids=' + item.order_product_id + '&sale_type=' + this.sale_type
|
.orderData.order_type + '&ids=' + item.order_product_id + '&sale_type=' + this
|
||||||
|
.sale_type
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
@ -459,4 +481,21 @@
|
|||||||
background: #F0F0F0;
|
background: #F0F0F0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
width: 590rpx;
|
||||||
|
height: 354rpx;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 50rpx 40rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :style="viewColor">
|
<view :style="viewColor">
|
||||||
<view class="product-window" :class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'')">
|
<view class="product-window"
|
||||||
|
:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'')">
|
||||||
<view class="textpic acea-row row-between-wrapper">
|
<view class="textpic acea-row row-between-wrapper">
|
||||||
<view class="pictrue">
|
<view class="pictrue">
|
||||||
<image :src="attr.productSelect.image ? attr.productSelect.image : image" @click="loookImg"></image>
|
<image :src="attr.productSelect.image ? attr.productSelect.image : image" @click="loookImg"></image>
|
||||||
@ -13,7 +14,8 @@
|
|||||||
<view>
|
<view>
|
||||||
预售价
|
预售价
|
||||||
¥<text class="num">{{ attr.productSelect.price }}</text>
|
¥<text class="num">{{ attr.productSelect.price }}</text>
|
||||||
<text v-if="presell_type === 2">定金¥<text class="num">{{ attr.productSelect.down_price }}</text></text>
|
<text v-if="presell_type === 2">定金¥<text
|
||||||
|
class="num">{{ attr.productSelect.down_price }}</text></text>
|
||||||
</view>
|
</view>
|
||||||
<text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text>
|
<text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text>
|
||||||
<text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text>
|
<text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text>
|
||||||
@ -23,7 +25,8 @@
|
|||||||
<view class="acea-row row-middle">
|
<view class="acea-row row-middle">
|
||||||
<view v-if="type=='points'" class="points_money">
|
<view v-if="type=='points'" class="points_money">
|
||||||
<image :src="`${domain}/static/images/jf-point.png`" mode=""></image>
|
<image :src="`${domain}/static/images/jf-point.png`" mode=""></image>
|
||||||
<text class="points-num">{{attr.productSelect.ot_price}}</text>积分 <text v-if="attr.productSelect.price > 0">+{{attr.productSelect.price}}元</text>
|
<text class="points-num">{{attr.productSelect.ot_price}}</text>积分 <text
|
||||||
|
v-if="attr.productSelect.price > 0">+{{attr.productSelect.price}}元</text>
|
||||||
<text v-if="limitCount > 0" class="points-limit">限购{{limitCount}}件</text>
|
<text v-if="limitCount > 0" class="points-limit">限购{{limitCount}}件</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
@ -49,8 +52,8 @@
|
|||||||
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
|
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
|
||||||
<view class="title">{{ item.attr_name }}</view>
|
<view class="title">{{ item.attr_name }}</view>
|
||||||
<view class="listn acea-row row-middle">
|
<view class="listn acea-row row-middle">
|
||||||
<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''" v-for="(itemn, indexn) in item.attr_value"
|
<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''"
|
||||||
@click="tapAttr(indexw, indexn)" :key="indexn">
|
v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)" :key="indexn">
|
||||||
{{itemn.attr}}
|
{{itemn.attr}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -60,25 +63,32 @@
|
|||||||
<view class="title">数量</view>
|
<view class="title">数量</view>
|
||||||
<view class="carnum acea-row row-left">
|
<view class="carnum acea-row row-left">
|
||||||
<view class="buy_limit" v-if="minCount>0 || maxCount>0">
|
<view class="buy_limit" v-if="minCount>0 || maxCount>0">
|
||||||
(<text v-if="minCount>0">{{minCount}}件起购<text v-if="minCount>0 && maxCount>0">,</text></text><text v-if="maxCount>0">最多{{maxCount}}件</text>)
|
(<text v-if="minCount>0">{{minCount}}件起购<text
|
||||||
|
v-if="minCount>0 && maxCount>0">,</text></text><text
|
||||||
|
v-if="maxCount>0">最多{{maxCount}}件</text>)
|
||||||
</view>
|
</view>
|
||||||
<view class="item reduce" :class="(attr.productSelect.cart_num <= 1 || (minCount>0 && attr.productSelect.cart_num<=minCount)) ? 'on' : ''" @click="CartNumDes">
|
<view class="item reduce"
|
||||||
|
:class="(attr.productSelect.cart_num <= 1 || (minCount>0 && attr.productSelect.cart_num<=minCount)) ? 'on' : ''"
|
||||||
|
@click="CartNumDes">
|
||||||
-
|
-
|
||||||
</view>
|
</view>
|
||||||
<view class='item num'>
|
<view class='item num'>
|
||||||
<input type="number" v-model="attr.productSelect.cart_num" data-name="productSelect.cart_num" @input="bindCode(attr.productSelect.cart_num)" @keydown.native="btKeyDown" @keyup.native="btKeyUp"></input>
|
<input type="number" v-model="attr.productSelect.cart_num" data-name="productSelect.cart_num"
|
||||||
|
@input="bindCode(attr.productSelect.cart_num)" @keydown.native="btKeyDown"
|
||||||
|
@keyup.native="btKeyUp"></input>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="iSplus" class="item plus" :class="(attr.productSelect.cart_num >= attr.productSelect.stock || destri || (maxCount>0&&attr.productSelect.cart_num>=maxCount)) ? 'on' : ''"
|
<view v-if="iSplus" class="item plus"
|
||||||
|
:class="(attr.productSelect.cart_num >= attr.productSelect.stock || destri || (maxCount>0&&attr.productSelect.cart_num>=maxCount)) ? 'on' : ''"
|
||||||
@click="CartNumAdd">+</view>
|
@click="CartNumAdd">+</view>
|
||||||
<view v-else class='item plus' :class='((attr.productSelect.cart_num >= attr.productSelect.quota_show)
|
<view v-else class='item plus'
|
||||||
|
:class='((attr.productSelect.cart_num >= attr.productSelect.quota_show)
|
||||||
|| (attr.productSelect.cart_num >= attr.productSelect.product_stock) || (maxCount>0&&attr.productSelect.cart_num>=maxCount)) ? "on":""'
|
|| (attr.productSelect.cart_num >= attr.productSelect.product_stock) || (maxCount>0&&attr.productSelect.cart_num>=maxCount)) ? "on":""'
|
||||||
@click='CartNumAdd'>+</view>
|
@click='CartNumAdd'>+</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="joinBnt b-color" v-if="destri && attr.productSelect.stock>0" @click="goCat">立即购买</view>
|
<view class="joinBnt b-color" v-if="destri && attr.productSelect.stock>0" @click="goCat">立即购买</view>
|
||||||
<view class="joinBnt on" v-else-if="destri && attr.productSelect.stock<=0">已售罄</view>
|
<view class="joinBnt on" v-else-if="destri && attr.productSelect.stock<=0">已售罄</view>
|
||||||
<view class="joinBnt b-color" v-if="iSbnt && attr.productSelect.stock>0"
|
<view class="joinBnt b-color" v-if="iSbnt && attr.productSelect.stock>0" @click="goCat">我要参团</view>
|
||||||
@click="goCat">我要参团</view>
|
|
||||||
<view class="joinBnt on" v-else-if="(iSbnt && attr.productSelect.stock<=0)">已售罄</view>
|
<view class="joinBnt on" v-else-if="(iSbnt && attr.productSelect.stock<=0)">已售罄</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
|
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
|
||||||
@ -95,7 +105,9 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import { mapGetters } from "vuex";
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
attr: {
|
attr: {
|
||||||
@ -165,8 +177,7 @@
|
|||||||
},
|
},
|
||||||
computed: mapGetters(['viewColor']),
|
computed: mapGetters(['viewColor']),
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {};
|
||||||
};
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.maxCount)
|
console.log(this.maxCount)
|
||||||
@ -195,7 +206,8 @@
|
|||||||
e.target.value = e.target.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g, "");
|
e.target.value = e.target.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g, "");
|
||||||
},
|
},
|
||||||
btKeyUp(e) {
|
btKeyUp(e) {
|
||||||
e.target.value = e.target.value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g,"")
|
e.target.value = e.target.value.replace(
|
||||||
|
/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, "")
|
||||||
},
|
},
|
||||||
closeAttr: function() {
|
closeAttr: function() {
|
||||||
this.$emit('myevent');
|
this.$emit('myevent');
|
||||||
@ -251,55 +263,67 @@
|
|||||||
padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
||||||
transform: translate3d(0, 100%, 0);
|
transform: translate3d(0, 100%, 0);
|
||||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
||||||
|
|
||||||
&.presell-window {
|
&.presell-window {
|
||||||
padding-bottom: 200rpx;
|
padding-bottom: 200rpx;
|
||||||
padding-bottom: calc(200rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
|
padding-bottom: calc(200rpx+ constant(safe-area-inset-bottom)); ///兼容 IOS<11.2/
|
||||||
padding-bottom: calc(200rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
padding-bottom: calc(200rpx + env(safe-area-inset-bottom)); ///兼容 IOS>11.2/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window.on {
|
.product-window.on {
|
||||||
transform: translate3d(0, 0, 0);
|
transform: translate3d(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window.join {
|
.product-window.join {
|
||||||
padding-bottom: 30rpx;
|
padding-bottom: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic {
|
.product-window .textpic {
|
||||||
padding: 0 80rpx 0 30rpx;
|
padding: 0 80rpx 0 30rpx;
|
||||||
margin-top: 29rpx;
|
margin-top: 29rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .pictrue {
|
.product-window .textpic .pictrue {
|
||||||
width: 150rpx;
|
width: 150rpx;
|
||||||
height: 150rpx;
|
height: 150rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .pictrue image {
|
.product-window .textpic .pictrue image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text {
|
.product-window .textpic .text {
|
||||||
width: 460rpx;
|
width: 460rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #202020;
|
color: #202020;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money {
|
.product-window .textpic .text .money {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
margin-top: 26rpx;
|
margin-top: 26rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: var(--view-priceColor);
|
color: var(--view-priceColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money .points_money {
|
.product-window .textpic .text .money .points_money {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money .points_money image {
|
.product-window .textpic .text .money .points_money image {
|
||||||
width: 26rpx;
|
width: 26rpx;
|
||||||
height: 26rpx;
|
height: 26rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money .points_money .points-num {
|
.product-window .textpic .text .money .points_money .points-num {
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money .points_money .points-limit {
|
.product-window .textpic .text .money .points_money .points-limit {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 10rpx;
|
padding: 0 10rpx;
|
||||||
@ -313,42 +337,52 @@
|
|||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
font-size: 18rpx;
|
font-size: 18rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .stock_count {
|
.product-window .stock_count {
|
||||||
margin-top: 5rpx;
|
margin-top: 5rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money .num {
|
.product-window .textpic .text .money .num {
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .money .stock {
|
.product-window .textpic .text .money .stock {
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-left: 18rpx;
|
margin-left: 18rpx;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .text .presell_price {
|
.product-window .textpic .text .presell_price {
|
||||||
color: #FF7F00;
|
color: #FF7F00;
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stock {
|
.stock {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-money {
|
.vip-money {
|
||||||
color: #282828;
|
color: #282828;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
margin-left: 6rpx;
|
margin-left: 6rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vipImg {
|
.vipImg {
|
||||||
width: 65rpx;
|
width: 65rpx;
|
||||||
height: 28rpx;
|
height: 28rpx;
|
||||||
margin-left: 4rpx;
|
margin-left: 4rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .textpic .iconfont {
|
.product-window .textpic .iconfont {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 30rpx;
|
right: 30rpx;
|
||||||
@ -356,22 +390,27 @@
|
|||||||
font-size: 35rpx;
|
font-size: 35rpx;
|
||||||
color: #8a8a8a;
|
color: #8a8a8a;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList {
|
.product-window .productWinList {
|
||||||
max-height: 395rpx;
|
max-height: 395rpx;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
margin-top: 36rpx;
|
margin-top: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item~.item {
|
.product-window .productWinList .item~.item {
|
||||||
margin-top: 36rpx;
|
margin-top: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item .title {
|
.product-window .productWinList .item .title {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item .listn {
|
.product-window .productWinList .item .listn {
|
||||||
padding: 0 30rpx 0 16rpx;
|
padding: 0 30rpx 0 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item .listn .itemn {
|
.product-window .productWinList .item .listn .itemn {
|
||||||
border: 1px solid #bbb;
|
border: 1px solid #bbb;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
@ -380,11 +419,13 @@
|
|||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
margin: 14rpx 0 0 14rpx;
|
margin: 14rpx 0 0 14rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .productWinList .item .listn .itemn.on {
|
.product-window .productWinList .item .listn .itemn.on {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: var(--view-theme);
|
background-color: var(--view-theme);
|
||||||
border-color: var(--view-theme);
|
border-color: var(--view-theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart {
|
.product-window .cart {
|
||||||
margin-top: 36rpx;
|
margin-top: 36rpx;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
@ -397,20 +438,24 @@
|
|||||||
-ms-flex-pack: justify;
|
-ms-flex-pack: justify;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .title {
|
.product-window .cart .title {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
line-height: 54rpx;
|
line-height: 54rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum {
|
.product-window .cart .carnum {
|
||||||
height: 54rpx;
|
height: 54rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .buy_limit {
|
.product-window .cart .carnum .buy_limit {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .item {
|
.product-window .cart .carnum .item {
|
||||||
border: 1px solid #a4a4a4;
|
border: 1px solid #a4a4a4;
|
||||||
width: 84rpx;
|
width: 84rpx;
|
||||||
@ -420,28 +465,34 @@
|
|||||||
color: #a4a4a4;
|
color: #a4a4a4;
|
||||||
font-size: 45rpx;
|
font-size: 45rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .reduce {
|
.product-window .cart .carnum .reduce {
|
||||||
border-right: 0;
|
border-right: 0;
|
||||||
border-radius: 6rpx 0 0 6rpx;
|
border-radius: 6rpx 0 0 6rpx;
|
||||||
line-height: 48rpx;
|
line-height: 48rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .reduce.on {
|
.product-window .cart .carnum .reduce.on {
|
||||||
border-color: #e3e3e3;
|
border-color: #e3e3e3;
|
||||||
color: #dedede;
|
color: #dedede;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .plus {
|
.product-window .cart .carnum .plus {
|
||||||
border-left: 0;
|
border-left: 0;
|
||||||
border-radius: 0 6rpx 6rpx 0;
|
border-radius: 0 6rpx 6rpx 0;
|
||||||
line-height: 46rpx;
|
line-height: 46rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .plus.on {
|
.product-window .cart .carnum .plus.on {
|
||||||
border-color: #e3e3e3;
|
border-color: #e3e3e3;
|
||||||
color: #dedede;
|
color: #dedede;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .cart .carnum .num {
|
.product-window .cart .carnum .num {
|
||||||
color: #282828;
|
color: #282828;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .joinBnt {
|
.product-window .joinBnt {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
width: 620rpx;
|
width: 620rpx;
|
||||||
@ -451,10 +502,12 @@
|
|||||||
line-height: 86rpx;
|
line-height: 86rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin: 21rpx auto 0 auto;
|
margin: 21rpx auto 0 auto;
|
||||||
|
|
||||||
&.b-color {
|
&.b-color {
|
||||||
background-color: var(--view-theme);
|
background-color: var(--view-theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-window .joinBnt.on {
|
.product-window .joinBnt.on {
|
||||||
background-color: #bbb;
|
background-color: #bbb;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -74,6 +74,11 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class='recommendList' :class="indexP?'on':''">
|
<view class='recommendList' :class="indexP?'on':''">
|
||||||
|
<view class="loadingicon acea-row row-center-wrapper"
|
||||||
|
v-if="!hostProduct || hostProduct.length == 0 || loading">
|
||||||
|
<text class="loading iconfont icon-jiazai loading-flex"></text>
|
||||||
|
{{ hotTitle }}
|
||||||
|
</view>
|
||||||
<WaterfallsFlow v-if="hostProduct.length>0" :wfList='hostProduct' @itemTap="goDetail" :type="0"
|
<WaterfallsFlow v-if="hostProduct.length>0" :wfList='hostProduct' @itemTap="goDetail" :type="0"
|
||||||
:sale_type="sale_type" />
|
:sale_type="sale_type" />
|
||||||
<view class='pictrue' v-if="!loading && hostProduct.length==0">
|
<view class='pictrue' v-if="!loading && hostProduct.length==0">
|
||||||
@ -139,6 +144,10 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
hotTitle: {
|
||||||
|
type: String,
|
||||||
|
default: '加载更多'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -161,12 +170,14 @@
|
|||||||
val: 4
|
val: 4
|
||||||
}],
|
}],
|
||||||
currTabs: 1,
|
currTabs: 1,
|
||||||
list: []
|
list: [],
|
||||||
|
tabsTop: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getArticleList();
|
this.getArticleList();
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
changeTab(e) {
|
changeTab(e) {
|
||||||
this.currTabs = e;
|
this.currTabs = e;
|
||||||
@ -186,6 +197,18 @@
|
|||||||
limit: 10
|
limit: 10
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.list = res.data.list;
|
this.list = res.data.list;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$util.getDom(this, '.tabs', res => {
|
||||||
|
// #ifdef APP
|
||||||
|
this.tabsTop = res.top + 10;
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
this.tabsTop = res.top;
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
}, 300)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goDetail(item) {
|
goDetail(item) {
|
||||||
@ -288,7 +311,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 0 -20rpx 30rpx;
|
margin: 0 -20rpx 10rpx;
|
||||||
padding-top: 20rpx;
|
padding-top: 20rpx;
|
||||||
|
|
||||||
.tabs-item {
|
.tabs-item {
|
||||||
@ -340,10 +363,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.information {
|
.information {
|
||||||
// display: flex;
|
|
||||||
// justify-content: space-between;
|
|
||||||
// margin-bottom: 20rpx;
|
|
||||||
|
|
||||||
.nav-item {
|
.nav-item {
|
||||||
width: 227rpx;
|
width: 227rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -389,6 +408,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loading-flex {
|
||||||
|
width: auto !important;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.pictrue {
|
.pictrue {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -15,9 +15,9 @@ let openPlantGrass = '-openPlantGrass-'
|
|||||||
|
|
||||||
let httpSix, httpApi;
|
let httpSix, httpApi;
|
||||||
|
|
||||||
const env = 'dev'; // 开发
|
// const env = 'dev'; // 开发
|
||||||
// const env = 'prod'; // 生产
|
// const env = 'prod'; // 生产
|
||||||
// const env = 'prew'; // 预上线
|
const env = 'prew'; // 预上线
|
||||||
|
|
||||||
switch (env) {
|
switch (env) {
|
||||||
case 'prod':
|
case 'prod':
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
"name": "惠农生活",
|
"name": "惠农生活",
|
||||||
"appid": "__UNI__3A527D1",
|
"appid": "__UNI__3A527D1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"versionName" : "2.0.52",
|
"versionName": "2.0.53",
|
||||||
"versionCode" : 2052,
|
"versionCode": 2053,
|
||||||
"transformPx": false,
|
"transformPx": false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
@ -126,7 +126,8 @@
|
|||||||
"weixin": {
|
"weixin": {
|
||||||
"appid": "wx2e8f79ff281284f5",
|
"appid": "wx2e8f79ff281284f5",
|
||||||
"UniversalLinks": "https://shop.lihaink.cn/"
|
"UniversalLinks": "https://shop.lihaink.cn/"
|
||||||
}
|
},
|
||||||
|
"univerify": {}
|
||||||
},
|
},
|
||||||
"ad": {}
|
"ad": {}
|
||||||
},
|
},
|
||||||
|
71
pages.json
@ -19,7 +19,33 @@
|
|||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
// #endif
|
// #endif
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"scrollIndicator": false //禁用原生导航栏
|
"scrollIndicator": false, //禁用原生导航栏
|
||||||
|
"subNVues": [{
|
||||||
|
"id": "concatIndex", // 唯一标识
|
||||||
|
"path": "pages/index/subnvue/concat", // 页面路径
|
||||||
|
"type": "popup",
|
||||||
|
"style": {
|
||||||
|
"position": "absolute",
|
||||||
|
"dock": "right",
|
||||||
|
"width": "750rpx",
|
||||||
|
"height": "1000px",
|
||||||
|
"background": "rgba(0,0,0,0.2)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "newUser", // 唯一标识
|
||||||
|
"path": "pages/index/subnvue/newUser", // 页面路径
|
||||||
|
"type": "popup",
|
||||||
|
"style": {
|
||||||
|
"position": "absolute",
|
||||||
|
"dock": "right",
|
||||||
|
"width": "750rpx",
|
||||||
|
"height": "1000px",
|
||||||
|
"background": "rgba(0,0,0,0.2)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -35,8 +61,21 @@
|
|||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"navigationBarTitleText": "工作台",
|
"navigationBarTitleText": "工作台",
|
||||||
"navigationStyle": "custom",
|
"navigationStyle": "custom",
|
||||||
"backgroundColorTop": "#40AE36",
|
"app-plus": {
|
||||||
"backgroundTextStyle": "light"
|
"scrollIndicator": false, //禁用原生导航栏
|
||||||
|
"subNVues": [{
|
||||||
|
"id": "concat", // 唯一标识
|
||||||
|
"path": "pages/gather/subnvue/concat", // 页面路径
|
||||||
|
"type": "popup",
|
||||||
|
"style": {
|
||||||
|
"position": "absolute",
|
||||||
|
"dock": "right",
|
||||||
|
"width": "750rpx",
|
||||||
|
"height": "1500rpx",
|
||||||
|
"background": "rgba(0,0,0,0.2)"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/order_addcart/order_addcart",
|
"path": "pages/order_addcart/order_addcart",
|
||||||
@ -56,7 +95,22 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"navigationBarTitleText": "个人中心",
|
"navigationBarTitleText": "个人中心",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"app-plus": {
|
||||||
|
"scrollIndicator": false, //禁用原生导航栏
|
||||||
|
"subNVues": [{
|
||||||
|
"id": "userSubnvu", // 唯一标识
|
||||||
|
"path": "pages/user/subnvue/index", // 页面路径
|
||||||
|
"type": "popup",
|
||||||
|
"style": {
|
||||||
|
"position": "absolute",
|
||||||
|
"dock": "right",
|
||||||
|
"width": "750rpx",
|
||||||
|
"height": "1500rpx",
|
||||||
|
"background": "rgba(0,0,0,0.2)"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -816,7 +870,14 @@
|
|||||||
"path": "settled/index",
|
"path": "settled/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "商家入驻",
|
"navigationBarTitleText": "商家入驻",
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "settled/index1",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商家入驻"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -841,7 +841,8 @@
|
|||||||
import {
|
import {
|
||||||
getProductDetail,
|
getProductDetail,
|
||||||
getPresellProductDetail,
|
getPresellProductDetail,
|
||||||
getStoreDetail
|
getStoreDetail,
|
||||||
|
consultApi
|
||||||
} from "@/api/store";
|
} from "@/api/store";
|
||||||
import {
|
import {
|
||||||
getCombinationDetail
|
getCombinationDetail
|
||||||
@ -1449,6 +1450,10 @@
|
|||||||
this.height();
|
this.height();
|
||||||
},
|
},
|
||||||
sendProduct() {
|
sendProduct() {
|
||||||
|
consultApi({
|
||||||
|
user_id: this.toUid,
|
||||||
|
product_id: this.productId
|
||||||
|
})
|
||||||
if (this.presellId || this.combinationId) {
|
if (this.presellId || this.combinationId) {
|
||||||
if (this.presellId) {
|
if (this.presellId) {
|
||||||
this.sendMsg(this.presellId, 7);
|
this.sendMsg(this.presellId, 7);
|
||||||
|
@ -312,7 +312,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 流水瀑布 -->
|
<!-- 流水瀑布 -->
|
||||||
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
||||||
<loadmore :type="isLoading" style="background-color: #fff;padding: 12rpx 0;"></loadmore>
|
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -114,7 +114,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<loadmore :type="isLoading" style="background-color: #fff;padding: 12rpx 0;"></loadmore>
|
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<!-- 流水瀑布 -->
|
<!-- 流水瀑布 -->
|
||||||
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
|
||||||
<loadmore :type="isLoading" style="background-color: #fff;padding: 12rpx 0;"></loadmore>
|
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -175,19 +175,18 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="title-img">
|
<view class="title-img">
|
||||||
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/807b8202403111125379295.webp" mode=""></image>
|
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/807b8202403111125379295.webp" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="business com special_work" v-if="jurisdiction == false">
|
<view class="business com special_work" v-if="jurisdiction == false">
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<block v-if="nowMenuList.length > 0">
|
<block v-if="nowMenuList.length > 0">
|
||||||
<u-transition v-for="(item, index) in nowMenuList" :key="item.name" show>
|
<u-transition v-for="(item, index) in nowMenuList" :key="item.name" show>
|
||||||
<view class="examine" @click.stop="editFlag ? removeMenu(item) : clickMenu(item)"
|
<view class="examine" @click.stop="editFlag ? removeMenu(item) : clickMenu(item)"
|
||||||
@longpress="editFlag = true">
|
@longpress="editFlag = true">
|
||||||
<image class="icon_img" :src="item.pic" mode="aspectFit">
|
<image class="icon_img gatherDiver" :src="item.pic" mode="aspectFit">
|
||||||
</image>
|
</image>
|
||||||
|
<!-- <u-icon v-if="editFlag" class="icon" name="minus-circle-fill" color="red"></u-icon> -->
|
||||||
<view v-if="editFlag" class="icon" style="background-color: red;">删除</view>
|
<view v-if="editFlag" class="icon" style="background-color: red;">删除</view>
|
||||||
<text class="text">{{ item.name }}</text>
|
<text class="text">{{ item.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
@ -213,6 +212,7 @@
|
|||||||
<u-transition v-for="(item, index) in AllMenuList" :key="item.name" show>
|
<u-transition v-for="(item, index) in AllMenuList" :key="item.name" show>
|
||||||
<view class="examine" @click.stop="pushMenu(item)">
|
<view class="examine" @click.stop="pushMenu(item)">
|
||||||
<image class="icon_img" :src="item.pic" mode="aspectFit"> </image>
|
<image class="icon_img" :src="item.pic" mode="aspectFit"> </image>
|
||||||
|
<!-- <u-icon class="icon" name="plus-circle-fill"></u-icon> -->
|
||||||
<view class="icon">添加</view>
|
<view class="icon">添加</view>
|
||||||
<text class="text">{{ item.name }}</text>
|
<text class="text">{{ item.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
@ -248,6 +248,9 @@
|
|||||||
} from "@/api/public";
|
} from "@/api/public";
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
import uniMP from '@/utils/uniMP.js';
|
import uniMP from '@/utils/uniMP.js';
|
||||||
|
import {
|
||||||
|
isNewMer
|
||||||
|
} from '@/api/user.js';
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -256,6 +259,8 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
subNVue: null,
|
||||||
|
elInfo: '',
|
||||||
imgUrls: [{
|
imgUrls: [{
|
||||||
img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e2f0520240203154207556.png'
|
img: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e2f0520240203154207556.png'
|
||||||
}],
|
}],
|
||||||
@ -291,13 +296,23 @@
|
|||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userInfo', 'location', 'isLogin'])
|
...mapGetters(['userInfo', 'location', 'isLogin'])
|
||||||
},
|
},
|
||||||
|
created() {},
|
||||||
|
onLoad() {
|
||||||
|
this.subNVue = uni.getSubNVueById('concat')
|
||||||
|
let that = this
|
||||||
|
uni.$on('diverGatherSubEmit', function(data) {
|
||||||
|
that.clickMenu(that.nowMenuList[0])
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
let that = this
|
||||||
this.street = this.$store.state.storage.address.townName;
|
this.street = this.$store.state.storage.address.townName;
|
||||||
this.getNav();
|
this.getNav();
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
this.emptyText = '暂无可用应用'
|
this.emptyText = '暂无可用应用'
|
||||||
this.jurisdiction = false
|
this.jurisdiction = false
|
||||||
this.initAllAppLet();
|
this.initAllAppLet(true);
|
||||||
} else {
|
} else {
|
||||||
this.emptyText = '请登录'
|
this.emptyText = '请登录'
|
||||||
this.jurisdiction = true
|
this.jurisdiction = true
|
||||||
@ -313,13 +328,38 @@
|
|||||||
menu = [];
|
menu = [];
|
||||||
}
|
}
|
||||||
this.nowMenuList = menu;
|
this.nowMenuList = menu;
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (Boolean(this.userInfo.service?.mer_id)) {
|
||||||
|
isNewMer(this.userInfo.uid, this.userInfo.service?.mer_id).then(
|
||||||
|
res => {
|
||||||
|
if (res.data == 'true') {
|
||||||
|
setTimeout(() => {
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
query
|
||||||
|
.select(".gatherDiver")
|
||||||
|
.boundingClientRect((data) => {
|
||||||
|
let info = JSON.stringify(data)
|
||||||
|
that.elInfo = data
|
||||||
|
that.openDiver()
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.getUserInfo()
|
this.getUserInfo()
|
||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
},
|
},
|
||||||
beforeDestroy() {},
|
beforeDestroy() {},
|
||||||
mounted() {},
|
onReady() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
const scrollTop = e.scrollTop;
|
const scrollTop = e.scrollTop;
|
||||||
@ -346,15 +386,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
openDiver() {
|
||||||
* 获取个人用户信息
|
this.subNVue.show('zoom-out', 300)
|
||||||
*/
|
uni.$emit('diverGatherEmit', this.elInfo);
|
||||||
getUserInfo: function() {
|
|
||||||
let that = this;
|
|
||||||
getUserInfo().then(res => {
|
|
||||||
showTab(res.data);
|
|
||||||
this.userInfo = res.data;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
changeSwiper(e) {
|
changeSwiper(e) {
|
||||||
if (e.length > 0 && e[1].value) {
|
if (e.length > 0 && e[1].value) {
|
||||||
@ -430,13 +464,13 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
initAllAppLet() {
|
initAllAppLet(flag) {
|
||||||
applet().then(res => {
|
applet().then(res => {
|
||||||
this.AllMenuList = res.data;
|
this.AllMenuList = res.data;
|
||||||
this.initMenu();
|
this.initMenu(flag);
|
||||||
this.showControllerAllLet();
|
this.showControllerAllLet();
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
console.log(e);
|
// console.log(e);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 根据类型来判断是否显示
|
// 根据类型来判断是否显示
|
||||||
@ -450,7 +484,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 初始化菜单
|
// 初始化菜单
|
||||||
initMenu() {
|
initMenu(flag = false) {
|
||||||
let nowMenu = uni.getStorageSync('gatherMenuList');
|
let nowMenu = uni.getStorageSync('gatherMenuList');
|
||||||
try {
|
try {
|
||||||
let list = JSON.parse(nowMenu || '[]');
|
let list = JSON.parse(nowMenu || '[]');
|
||||||
@ -460,8 +494,12 @@
|
|||||||
if (list.find(t => t.name == item.name)?.name != item.name) all.push(item);
|
if (list.find(t => t.name == item.name)?.name != item.name) all.push(item);
|
||||||
else now.push(item)
|
else now.push(item)
|
||||||
})
|
})
|
||||||
|
if (flag && !now.length) {
|
||||||
|
this.$set(now, 0, all[0])
|
||||||
|
}
|
||||||
this.AllMenuList = all;
|
this.AllMenuList = all;
|
||||||
this.nowMenuList = now;
|
this.nowMenuList = now;
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.nowMenuList = [];
|
this.nowMenuList = [];
|
||||||
}
|
}
|
||||||
@ -490,7 +528,6 @@
|
|||||||
},
|
},
|
||||||
getUniMp(data) {
|
getUniMp(data) {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
if (data.version) return uniMP.loadAppletMP(data);
|
if (data.version) return uniMP.loadAppletMP(data);
|
||||||
else switch (data.type) {
|
else switch (data.type) {
|
||||||
@ -510,14 +547,6 @@
|
|||||||
return;
|
return;
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
// if (type == 2) {
|
|
||||||
// this.navigator(`/pages/moreProject/moreProject`);
|
|
||||||
// } else {
|
|
||||||
// uni.showToast({
|
|
||||||
// icon: 'none',
|
|
||||||
// title: 'H5不支持打开小程序'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: 'H5不支持打开小程序'
|
title: 'H5不支持打开小程序'
|
||||||
@ -526,7 +555,6 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
navigator(url, t) {
|
navigator(url, t) {
|
||||||
// if (this.userInfoData.is_wsxx === 0 && t != '商户设置') return Toast("请完善商户信息");
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url
|
url: url
|
||||||
})
|
})
|
||||||
@ -534,6 +562,8 @@
|
|||||||
getUserInfo: function() {
|
getUserInfo: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
getUserInfo().then(res => {
|
getUserInfo().then(res => {
|
||||||
|
showTab(res.data);
|
||||||
|
that.userInfo = res.data;
|
||||||
that.userInfoData = res.data;
|
that.userInfoData = res.data;
|
||||||
that.$store.commit('SET_USERINFO', res.data);
|
that.$store.commit('SET_USERINFO', res.data);
|
||||||
// console.log(res.data.service);
|
// console.log(res.data.service);
|
||||||
|
191
pages/gather/subnvue/concat.nvue
Normal file
@ -0,0 +1,191 @@
|
|||||||
|
<template>
|
||||||
|
<view class="" style="width: 750rpx;height: 100%;">
|
||||||
|
<view class="jump" @click="jump">
|
||||||
|
<text class="font">跳过</text>
|
||||||
|
</view>
|
||||||
|
<view class="tabbar" :style="{top:(top-12)+'px',left:(left-12)+'px'}">
|
||||||
|
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0fa43202312291702314919.png" class="tab-icon">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<view class="" class="pointe" :style="{ left:(left-10)+'px',top:(top)+'px'}">
|
||||||
|
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="center" :style="{left:(left+20)+'px', top:(top+55)+'px'}">
|
||||||
|
<image src="/static/images/greenLineDown.png" style="width:35px;height: 60px;" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="tips-box" :style="{ left:left+'px',top:(top+80)+'px'}">
|
||||||
|
<view class="tips" style="position: absolute;padding-left: 10rpx;">
|
||||||
|
<view class="tras" :class="{act:isActive}">
|
||||||
|
<text style="font-size: 28rpx;line-height: 100rpx;color: white;">点击供销助农平台进入商户平台</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image src="/static/images/starpng.png" class="start" mode="">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<view class="next-btn center">
|
||||||
|
<text class="next-btn-text font" @click="next">下一步(2/4)</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
isNewMer
|
||||||
|
} from '@/api/user.js';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isActive: false,
|
||||||
|
left: 0,
|
||||||
|
top: 0,
|
||||||
|
subNVue: null,
|
||||||
|
offsetX: 0,
|
||||||
|
offsetY: 0,
|
||||||
|
iconWidth: 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
next() {
|
||||||
|
this.subNVue.hide('zoom-in', 300, )
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.$emit('diverGatherSubEmit');
|
||||||
|
}, 500)
|
||||||
|
|
||||||
|
},
|
||||||
|
jump() {
|
||||||
|
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id, {
|
||||||
|
done: 1
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res, 'res')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
let that = this
|
||||||
|
this.subNVue = uni.getSubNVueById('concat')
|
||||||
|
uni.$on('diverGatherEmit', (data) => {
|
||||||
|
that.left = data.left
|
||||||
|
that.top = data.top
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
that.isActive = true
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.jump {
|
||||||
|
position: absolute;
|
||||||
|
right: 30rpx;
|
||||||
|
top: 80rpx;
|
||||||
|
border: 1px solid white;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .tips {
|
||||||
|
width: 462rpx;
|
||||||
|
height: 106rpx;
|
||||||
|
background-color: #5BE157;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
} */
|
||||||
|
.tips-box {
|
||||||
|
width: 462rpx;
|
||||||
|
height: 178rpx;
|
||||||
|
position: absolute;
|
||||||
|
padding-top: 72rpx;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.start {
|
||||||
|
width: 72rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
width: 462rpx;
|
||||||
|
height: 106rpx;
|
||||||
|
background-color: #5BE157;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
position: absolute;
|
||||||
|
left: 375rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar {
|
||||||
|
width: 136rpx;
|
||||||
|
height: 136rpx;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 136rpx;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-icon {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 68rpx;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
top: 68rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.te {
|
||||||
|
font-size: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 68rpx;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
top: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pointe {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.tras {
|
||||||
|
padding-left: 10rpx;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 999 !important;
|
||||||
|
width: 20px;
|
||||||
|
transition-property: width;
|
||||||
|
transition-duration: 3s;
|
||||||
|
transition-delay: 0.1s;
|
||||||
|
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.act {
|
||||||
|
width: 462rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: white;
|
||||||
|
lines: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-btn {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 100px;
|
||||||
|
left: 375rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
width: 240rpx;
|
||||||
|
height: 76rpx;
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 38rpx;
|
||||||
|
background-color: rgba(255, 255, 255, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-btn-text {
|
||||||
|
line-height: 76rpx;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
@ -336,13 +336,14 @@
|
|||||||
</view>
|
</view>
|
||||||
<view v-if="description.content && description.content.image" class="pictures">
|
<view v-if="description.content && description.content.image" class="pictures">
|
||||||
<view class="" v-for="(item,index) in description.content.image" :key="index">
|
<view class="" v-for="(item,index) in description.content.image" :key="index">
|
||||||
<view style="position: relative;"
|
<view style="position: relative;" v-if='videoTypeList.includes(getSuffix(item))'
|
||||||
v-if='videoTypeList.includes(getSuffix(item))' @click="navGoPlay(item)">
|
@click="navGoPlay(item)">
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<image :src="item+coverUrl" mode="widthFix"
|
<image :src="item+coverUrl" mode="widthFix"
|
||||||
style="background-color: #fff;width: 100vw;" />
|
style="background-color: #fff;width: 100vw;" />
|
||||||
<!-- <image class="image-play-icon" src="/static/images/stop.png"> -->
|
<!-- <image class="image-play-icon" src="/static/images/stop.png"> -->
|
||||||
<u--image class="image-play-icon" src="/static/images/stop.png" width="100rpx" height="100rpx" ></u--image>
|
<u--image class="image-play-icon" src="/static/images/stop.png"
|
||||||
|
width="100rpx" height="100rpx"></u--image>
|
||||||
</image>
|
</image>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef APP-PLUS -->
|
<!-- #ifndef APP-PLUS -->
|
||||||
|
@ -18,6 +18,13 @@
|
|||||||
我是农民用户
|
我是农民用户
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="li" style="margin-top: 50rpx;" @click="navSw('/pages/index/index',true)">
|
||||||
|
<u-image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/static/merchant.webp" width="690rpx"
|
||||||
|
height="200rpx" style="position: absolute;"></u-image>
|
||||||
|
<view class="btn">
|
||||||
|
我是商户
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -37,7 +44,9 @@
|
|||||||
url
|
url
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
navSw(url) {
|
navSw(url, isNewStore) {
|
||||||
|
uni.setStorageSync('newStore', Boolean(isNewStore))
|
||||||
|
// return
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: url
|
url: url
|
||||||
})
|
})
|
||||||
|
@ -11,7 +11,8 @@
|
|||||||
<!-- #ifdef H5 -->
|
<!-- #ifdef H5 -->
|
||||||
<homeComb v-if="smallPage" class="home-comb" :isScale="isScale" :isMenu="isMenu"
|
<homeComb v-if="smallPage" class="home-comb" :isScale="isScale" :isMenu="isMenu"
|
||||||
:dataConfig="homeCombData" :userInfo="userInfo" :isFixed="isFixed" :isScrolled="isScrolled"
|
:dataConfig="homeCombData" :userInfo="userInfo" :isFixed="isFixed" :isScrolled="isScrolled"
|
||||||
@changeDiy="changeDiy"></homeComb>
|
@changeDiy="changeDiy">
|
||||||
|
</homeComb>
|
||||||
<view v-for="(item, index) in styleConfig" :key="index">
|
<view v-for="(item, index) in styleConfig" :key="index">
|
||||||
<block
|
<block
|
||||||
v-if="item.name != 'headerSerch' && item.name != 'tabNav' && item.name != 'shopList' && item.name != 'homeComb' && item.name != 'hotRanking' && item.name != 'pageFoot'">
|
v-if="item.name != 'headerSerch' && item.name != 'tabNav' && item.name != 'shopList' && item.name != 'homeComb' && item.name != 'hotRanking' && item.name != 'pageFoot'">
|
||||||
@ -44,7 +45,7 @@
|
|||||||
<!-- 首发新品 -->
|
<!-- 首发新品 -->
|
||||||
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
|
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
|
||||||
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"
|
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"
|
||||||
:loading="loading">
|
:loading="hotLoading[hostIndex]" :hotTitle="hotTitle">
|
||||||
</recommend>
|
</recommend>
|
||||||
<view class="loadingicon acea-row row-center-wrapper"
|
<view class="loadingicon acea-row row-center-wrapper"
|
||||||
v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]">
|
v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]">
|
||||||
@ -109,7 +110,7 @@
|
|||||||
<!-- 首发新品 -->
|
<!-- 首发新品 -->
|
||||||
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
|
<recommend ref="recommendRef" :hostProduct="hostProduct[hostIndex]"
|
||||||
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"
|
@changeRecommedTab="changeRecommedTab" showTab :indexP="true" :isLogin="isLogin"
|
||||||
:loading="loading">
|
:loading="hotLoading[hostIndex]" :hotTitle="hotTitle">
|
||||||
</recommend>
|
</recommend>
|
||||||
<view class="loadingicon acea-row row-center-wrapper"
|
<view class="loadingicon acea-row row-center-wrapper"
|
||||||
v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]">
|
v-if="hostProduct[hostIndex].length > 0 || hotLoading[hostIndex]">
|
||||||
@ -280,7 +281,7 @@
|
|||||||
<passwordPopup></passwordPopup>
|
<passwordPopup></passwordPopup>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!--自定义底部tab栏-->
|
<!--自定义底部tab栏-->
|
||||||
<customTab :newData="newData" :activeRouter="activeRouter"></customTab>
|
<!-- <customTab :newData="newData" :activeRouter="activeRouter"></customTab> -->
|
||||||
<view v-if="overflow" class="overflow-mask" @touchmove.stop.prevent="() => {}"></view>
|
<view v-if="overflow" class="overflow-mask" @touchmove.stop.prevent="() => {}"></view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -297,7 +298,8 @@
|
|||||||
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
||||||
let app = getApp();
|
let app = getApp();
|
||||||
import {
|
import {
|
||||||
getUserInfo
|
getUserInfo,
|
||||||
|
isNewMer
|
||||||
} from '@/api/user.js';
|
} from '@/api/user.js';
|
||||||
import {
|
import {
|
||||||
getDiy,
|
getDiy,
|
||||||
@ -450,6 +452,8 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
subNvue: null,
|
||||||
|
diverFlag: true,
|
||||||
domain: HTTP_REQUEST_URL,
|
domain: HTTP_REQUEST_URL,
|
||||||
couponTypeMsg: {
|
couponTypeMsg: {
|
||||||
10: '通用券',
|
10: '通用券',
|
||||||
@ -543,7 +547,8 @@
|
|||||||
preview: false,
|
preview: false,
|
||||||
isSupport: true,
|
isSupport: true,
|
||||||
isIndexClick: true,
|
isIndexClick: true,
|
||||||
scrollTop: 0
|
scrollTop: 0,
|
||||||
|
tabScroll: 0
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -615,6 +620,11 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
// #endif
|
// #endif
|
||||||
|
created(options) {
|
||||||
|
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
||||||
|
let curRoute = routes[routes.length - 1].route //获取当前页面路由
|
||||||
|
this.activeRouter = '/' + curRoute
|
||||||
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
this._options = options;
|
this._options = options;
|
||||||
@ -633,14 +643,10 @@
|
|||||||
that.pageLoad(options);
|
that.pageLoad(options);
|
||||||
this.$store.dispatch('INIT_CONFIG');
|
this.$store.dispatch('INIT_CONFIG');
|
||||||
},
|
},
|
||||||
created(options) {
|
|
||||||
let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
|
|
||||||
let curRoute = routes[routes.length - 1].route //获取当前页面路由
|
|
||||||
this.activeRouter = '/' + curRoute
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
let that = this;
|
|
||||||
|
|
||||||
|
onShow() {
|
||||||
|
if (uni.getStorageSync('newStore')) this.openDiver();
|
||||||
|
let that = this;
|
||||||
that.isIntegral = uni.getStorageSync('isIntegral')
|
that.isIntegral = uni.getStorageSync('isIntegral')
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
if (that.appUpdate.openUpgrade == '1') {
|
if (that.appUpdate.openUpgrade == '1') {
|
||||||
@ -688,7 +694,48 @@
|
|||||||
}, 50)
|
}, 50)
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
/*新商户引导页相关*/
|
||||||
|
openDiver() {
|
||||||
|
// #ifdef APP
|
||||||
|
this.subNvue = uni.getSubNVueById('newUser')
|
||||||
|
this.subNvue.show('slide-in-left', 300)
|
||||||
|
uni.$on('offSubnvue', () => {
|
||||||
|
this.subNvue.hide('slide-out-left')
|
||||||
|
if (uni.getStorageSync("newStore")) {
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/user/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// uni.$on('diverIndexSubEmit', () => {
|
||||||
|
// this.subNvue.hide('slide-out-left')
|
||||||
|
// uni.switchTab({
|
||||||
|
// url: '/pages/gather/gather'
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
},
|
||||||
|
/* 新商户发布商品引导页 */
|
||||||
|
openListGoodsDiver() {
|
||||||
|
if (Boolean(this.userInfo.service?.mer_id)) {
|
||||||
|
uni.$on('diverIndexSubEmit', () => {
|
||||||
|
this.subNvue.hide('slide-out-left')
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/gather/gather'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
isNewMer(this.userInfo.uid, this.userInfo.service?.mer_id).then(
|
||||||
|
res => {
|
||||||
|
if (res.data == 'true') {
|
||||||
|
this.subNvue = uni.getSubNVueById('concatIndex')
|
||||||
|
this.subNvue.show('slide-in-left', 300)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
loadCoupon() {
|
loadCoupon() {
|
||||||
if (!this.showCoupon && !uni.getStorageSync('show_coupon') && uni.getStorageSync('is_new_user')) {
|
if (!this.showCoupon && !uni.getStorageSync('show_coupon') && uni.getStorageSync('is_new_user')) {
|
||||||
getNewPeopleCouponLst().then(res => {
|
getNewPeopleCouponLst().then(res => {
|
||||||
@ -748,7 +795,7 @@
|
|||||||
},
|
},
|
||||||
bindHeighta(data) {
|
bindHeighta(data) {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
this.sortMpTop = data.top + data.height;
|
// this.sortMpTop = data.top + data.height;
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
// 重新链接
|
// 重新链接
|
||||||
@ -1026,8 +1073,12 @@
|
|||||||
showTab(res.data);
|
showTab(res.data);
|
||||||
that.userInfo = res.data;
|
that.userInfo = res.data;
|
||||||
this.$store.commit('SET_USERINFO', res.data);
|
this.$store.commit('SET_USERINFO', res.data);
|
||||||
|
// #ifdef APP
|
||||||
|
this.openListGoodsDiver()
|
||||||
|
// #endif
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 记录会员访问
|
// 记录会员访问
|
||||||
setVisit() {
|
setVisit() {
|
||||||
setVisit({
|
setVisit({
|
||||||
@ -1061,6 +1112,7 @@
|
|||||||
self.sortMarTop = 10;
|
self.sortMarTop = 10;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//分类产品
|
//分类产品
|
||||||
get_product_list: function() {
|
get_product_list: function() {
|
||||||
let that = this;
|
let that = this;
|
||||||
@ -1081,10 +1133,10 @@
|
|||||||
that.loadTitle = '加载更多';
|
that.loadTitle = '加载更多';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 点击组件选项卡
|
//点击组件选项卡
|
||||||
*/
|
|
||||||
changeRecommedTab(e) {
|
changeRecommedTab(e) {
|
||||||
|
let that = this;
|
||||||
this.hotPage = 1;
|
this.hotPage = 1;
|
||||||
this.hotScroll = true;
|
this.hotScroll = true;
|
||||||
this.hostIndex = e - 1;
|
this.hostIndex = e - 1;
|
||||||
@ -1092,11 +1144,14 @@
|
|||||||
hostList[e - 1] = [];
|
hostList[e - 1] = [];
|
||||||
this.$set(this, 'hostProduct', hostList);
|
this.$set(this, 'hostProduct', hostList);
|
||||||
this.loadGoods(e);
|
this.loadGoods(e);
|
||||||
|
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: that.$refs.recommendRef.tabsTop,
|
||||||
|
duration: 200
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
loadGoods(e = 1) {
|
loadGoods(e = 1) {
|
||||||
|
|
||||||
console.log(e);
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (e == 1) return this.get_host_product(0);
|
if (e == 1) return this.get_host_product(0);
|
||||||
if (e == 2) return this.get_host_home({
|
if (e == 2) return this.get_host_home({
|
||||||
@ -1110,12 +1165,12 @@
|
|||||||
}, 3);
|
}, 3);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 获取我的推荐
|
// 获取我的推荐
|
||||||
*/
|
|
||||||
get_host_product: function(e = 0) {
|
get_host_product: function(e = 0) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let num = that.hotLimit;
|
let num = that.hotLimit;
|
||||||
|
|
||||||
if (!that.hotScroll) return;
|
if (!that.hotScroll) return;
|
||||||
if (that.hotLoading[e]) return;
|
if (that.hotLoading[e]) return;
|
||||||
|
|
||||||
@ -1125,24 +1180,25 @@
|
|||||||
uni.stopPullDownRefresh();
|
uni.stopPullDownRefresh();
|
||||||
res.data.list = this.shuffleArray(res.data.list);
|
res.data.list = this.shuffleArray(res.data.list);
|
||||||
let list = res.data.list;
|
let list = res.data.list;
|
||||||
|
|
||||||
let productList = that.hostProduct;
|
let productList = that.hostProduct;
|
||||||
if (!productList[e]) productList[e] = [];
|
if (!productList[e]) productList[e] = [];
|
||||||
productList[e] = [...productList[e], ...res.data.list];
|
productList[e] = [...productList[e], ...res.data.list];
|
||||||
|
|
||||||
let hotScroll = list.length <= res.data.limit && list.length != 0;
|
let hotScroll = list.length <= res.data.limit && list.length != 0;
|
||||||
that.hotScroll = hotScroll;
|
that.hotScroll = hotScroll;
|
||||||
that.hotLoading[e] = false;
|
that.hotLoading[e] = false;
|
||||||
that.hotTitle = !hotScroll ? '已全部加载' : '加载更多';
|
that.hotTitle = !hotScroll ? '已全部加载' : '加载更多';
|
||||||
|
|
||||||
that.$set(that, 'hostProduct', productList);
|
that.$set(that, 'hostProduct', productList);
|
||||||
if (this.hostIndex == e) this.$forceUpdate();
|
|
||||||
|
|
||||||
that.$set(that, 'hotPage', res.data.page + 1);
|
that.$set(that, 'hotPage', res.data.page + 1);
|
||||||
that.$set(that, 'hotLimit', res.data.limit);
|
that.$set(that, 'hotLimit', res.data.limit);
|
||||||
|
|
||||||
|
this.$forceUpdate();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 获取里海云仓, 云市场, 名优特产
|
// 获取里海云仓, 云市场, 名优特产
|
||||||
*/
|
|
||||||
get_host_home: function(query = {}, e = 1) {
|
get_host_home: function(query = {}, e = 1) {
|
||||||
let that = this;
|
let that = this;
|
||||||
let num = that.hotLimit;
|
let num = that.hotLimit;
|
||||||
@ -1191,11 +1247,13 @@
|
|||||||
this.$set(this, 'navTop', res.data);
|
this.$set(this, 'navTop', res.data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
reloadData() {
|
reloadData() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.showSkeleton = false
|
this.showSkeleton = false
|
||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 首发新品详情
|
// 首发新品详情
|
||||||
goDetail(item) {
|
goDetail(item) {
|
||||||
if (item.activity && item.activity.type === '2' && !this.isLogin) {
|
if (item.activity && item.activity.type === '2' && !this.isLogin) {
|
||||||
@ -1239,6 +1297,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
ShareInfo(datas) {
|
ShareInfo(datas) {
|
||||||
let data = this.storeInfo;
|
let data = this.storeInfo;
|
||||||
@ -1274,6 +1333,7 @@
|
|||||||
this.domHeight = res[0].height;
|
this.domHeight = res[0].height;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 滚动到底部
|
// 滚动到底部
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.recommend_switch == 1 && this.navIndex == 0) {
|
if (this.recommend_switch == 1 && this.navIndex == 0) {
|
||||||
@ -1285,7 +1345,7 @@
|
|||||||
this.get_product_list();
|
this.get_product_list();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
213
pages/index/subnvue/concat.nvue
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
<template>
|
||||||
|
<view class="" style="width: 750rpx;height: 100%;">
|
||||||
|
<view class="jump" @click="jump">
|
||||||
|
<text class="font">跳过</text>
|
||||||
|
</view>
|
||||||
|
<view class="next-btn" :style="{top:(offsetY-250)+'px'}">
|
||||||
|
<text class="next-btn-text font" @click="next">下一步(1/4)</text>
|
||||||
|
</view>
|
||||||
|
<view class="tips-box" :style="{right:20, top:(offsetY-218)+'px'}">
|
||||||
|
<view class="tips" style="position: absolute;padding-left: 10rpx;">
|
||||||
|
<view class="tras" :class="{act:isActive}">
|
||||||
|
<text style="font-size: 28rpx;line-height: 100rpx;color: white;">点击工作台,进入办公助手</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image src="/static/images/starpng.png" class="start" mode="">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<view style="position: absolute;" class="center" :style="{top:(offsetY-120)+'px'}">
|
||||||
|
<image src="/static/images/greenLine.png" style="width:35px;height: 60px;" mode=""></image>
|
||||||
|
</view>
|
||||||
|
<view class="tabbar2 center" :style="{top:(offsetY-68)+'px'}">
|
||||||
|
<image src="/static/images/ydwd.png" class="tab-icon"></image>
|
||||||
|
<text class="te">工作台</text>
|
||||||
|
</view>
|
||||||
|
<view class="pointe2" :style="{top:(offsetY-58)+'px'}">
|
||||||
|
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;" mode=""></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
isNewMer
|
||||||
|
} from '@/api/user.js';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
isActive: false,
|
||||||
|
subNVue: null,
|
||||||
|
screenWidth: 400,
|
||||||
|
offsetX: 0,
|
||||||
|
offsetY: 0,
|
||||||
|
isStore: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
next() {
|
||||||
|
uni.$emit('diverIndexSubEmit');
|
||||||
|
|
||||||
|
},
|
||||||
|
jump() {
|
||||||
|
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id, {
|
||||||
|
done: 1
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res, 'res')
|
||||||
|
})
|
||||||
|
uni.$emit('diverIndexSubEmit');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
uni.$on('diverIndexEmit', (data) => {
|
||||||
|
this.isStore = Boolean(data.mer_info?.mer_name)
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
this.subNVue = uni.getSubNVueById('concatIndex')
|
||||||
|
const res = uni.getSystemInfo({
|
||||||
|
success: (res => {
|
||||||
|
this.offsetY = res.screenHeight
|
||||||
|
this.screenWidth = res.screenWidth
|
||||||
|
})
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
that.isActive = true
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.jump {
|
||||||
|
position: absolute;
|
||||||
|
right: 30rpx;
|
||||||
|
top: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips-box {
|
||||||
|
width: 462rpx;
|
||||||
|
height: 178rpx;
|
||||||
|
position: absolute;
|
||||||
|
padding-top: 72rpx;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.start {
|
||||||
|
width: 72rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
width: 462rpx;
|
||||||
|
height: 106rpx;
|
||||||
|
background-color: #5BE157;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
position: absolute;
|
||||||
|
left: 375rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar {
|
||||||
|
width: 136rpx;
|
||||||
|
height: 136rpx;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 136rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 375rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
/* bottom: 0; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar2 {
|
||||||
|
width: 136rpx;
|
||||||
|
height: 136rpx;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 136rpx;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-icon {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 68rpx;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
top: 68rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.te {
|
||||||
|
font-size: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 68rpx;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
top: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pointe {
|
||||||
|
position: absolute;
|
||||||
|
left: 420rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pointe2 {
|
||||||
|
position: absolute;
|
||||||
|
left: 420rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
/* left: 150rpx; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.tras {
|
||||||
|
padding-left: 10rpx;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 999 !important;
|
||||||
|
width: 0px;
|
||||||
|
transition-property: width;
|
||||||
|
transition-duration: 3s;
|
||||||
|
transition-delay: 0.1s;
|
||||||
|
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.act {
|
||||||
|
width: 462rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: white;
|
||||||
|
lines: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-btn {
|
||||||
|
position: absolute;
|
||||||
|
/* bottom: 100rpx; */
|
||||||
|
left: 375rpx;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
width: 240rpx;
|
||||||
|
height: 76rpx;
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 38rpx;
|
||||||
|
background-color: rgba(255, 255, 255, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-btn-text {
|
||||||
|
line-height: 76rpx;
|
||||||
|
text-align: center;
|
||||||
|
/* background-color: #939393; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.jump {
|
||||||
|
position: absolute;
|
||||||
|
right: 30rpx;
|
||||||
|
top: 80rpx;
|
||||||
|
border: 1px solid white;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
</style>
|
167
pages/index/subnvue/newUser.nvue
Normal file
@ -0,0 +1,167 @@
|
|||||||
|
<template>
|
||||||
|
<view class="">
|
||||||
|
<view class="jump" @click="jump">
|
||||||
|
<text class="font">跳过</text>
|
||||||
|
</view>
|
||||||
|
<view class="next-btn center" :style="{ left:screenWidth/2,top:(screenHeight-96)}">
|
||||||
|
<text class="next-btn-text font" style="line-height: 76rpx;" @click="next">下一步(1/2)</text>
|
||||||
|
</view>
|
||||||
|
<view class="target" :style="{left:screenWidth/4*3,top:screenHeight-68}">
|
||||||
|
<image src="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/96aba202405171618278261.png"
|
||||||
|
class="target-icon"></image>
|
||||||
|
<text class="target-text">我的</text>
|
||||||
|
</view>
|
||||||
|
<view :style="{left:screenWidth/4*3,top:screenHeight-130}">
|
||||||
|
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;"></image>
|
||||||
|
</view>
|
||||||
|
<view class="tips-box" :style="{right:20,top:screenHeight-220}">
|
||||||
|
<view class="tips" style="position: absolute;padding-left: 20px;">
|
||||||
|
<view class="tras" :class="{act:isAct}">
|
||||||
|
<text style="font-size: 28rpx;line-height: 100rpx;color: white;">点击我的页面,进行商户入驻</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image src="/static/images/starpng.png" class="start" mode="">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<image src="/static/images/greenLine.png" class="greenLine"
|
||||||
|
:style="{left:screenWidth/4*3+15,top:screenHeight-120}" mode=""></image>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
screenHeight: 800,
|
||||||
|
screenWidth: 375,
|
||||||
|
isAct: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
jump() {
|
||||||
|
uni.setStorageSync("newStore", false)
|
||||||
|
uni.$emit('offSubnvue');
|
||||||
|
},
|
||||||
|
next() {
|
||||||
|
uni.$emit('offSubnvue');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
let that = this
|
||||||
|
const res = uni.getSystemInfo({
|
||||||
|
success: (res => {
|
||||||
|
this.screenHeight = res.screenHeight
|
||||||
|
this.screenWidth = res.screenWidth
|
||||||
|
})
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
that.isAct = true
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.jump {
|
||||||
|
position: absolute;
|
||||||
|
right: 30rpx;
|
||||||
|
top: 80rpx;
|
||||||
|
border: 1px solid white;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: white;
|
||||||
|
lines: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-btn {
|
||||||
|
position: absolute;
|
||||||
|
width: 240rpx;
|
||||||
|
height: 76rpx;
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 38rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.target {
|
||||||
|
width: 136rpx;
|
||||||
|
height: 136rpx;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 136rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.target-icon {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 68rpx;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
top: 68rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.target-text {
|
||||||
|
font-size: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 68rpx;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
top: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pointer {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips-box {
|
||||||
|
width: 462rpx;
|
||||||
|
height: 178rpx;
|
||||||
|
position: absolute;
|
||||||
|
padding-top: 72rpx;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.start {
|
||||||
|
width: 72rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
width: 462rpx;
|
||||||
|
height: 106rpx;
|
||||||
|
background-color: #5BE157;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.tras {
|
||||||
|
width: 0px;
|
||||||
|
transition-property: width;
|
||||||
|
transition-duration: 3s;
|
||||||
|
transition-delay: 0.1s;
|
||||||
|
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.act {
|
||||||
|
width: 462rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.greenLine {
|
||||||
|
width: 35px;
|
||||||
|
height: 60px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,7 +1,50 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view style="padding: 42rpx 50rpx;">
|
||||||
|
|
||||||
|
<view class="card" v-for="item in listData" :key="item.mer_intention_id">
|
||||||
|
<view class="" style="display: flex;align-items: center;">
|
||||||
|
<view class="ciecle"
|
||||||
|
style="width: 24rpx;height: 24rpx;border-radius: 24rpx;border: 1px solid #DDDDDD;margin-right: 30rpx;">
|
||||||
|
</view>
|
||||||
|
<view class="" style="color: #777777;font-size: 24rpx;">
|
||||||
|
{{item.create_time}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class=""
|
||||||
|
style="padding:40rpx;margin: 30rpx 0; width: 606rpx;margin-left: 30rpx;border-radius: 16rpx;box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0,0,0,0.16);">
|
||||||
|
<view class="" v-if="item.status==0" style="color: #20B128;font-size: 32rpx;">
|
||||||
|
待审核
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="" v-if="item.status==1" style="color: #20B128;font-size: 32rpx;">
|
||||||
|
审核通过
|
||||||
|
</view>
|
||||||
|
<view class="" v-if="item.status==2"
|
||||||
|
style="color: #FC452F;font-size: 32rpx;display: flex;justify-content: space-between;">
|
||||||
|
审核失败
|
||||||
|
<view style="color: #20B128;" @click="navgo">
|
||||||
|
重新申请
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-line style="margin: 28rpx 0;"></u-line>
|
||||||
|
<view class="" style="margin-bottom: 20rpx;">
|
||||||
|
{{item.mer_name}}
|
||||||
|
</view>
|
||||||
|
<view class="" v-if="item.status==1" style="font-size: 24rpx; color: #777777;">
|
||||||
|
可以登录我们的工作台,把您的商品推向市场了
|
||||||
|
</view>
|
||||||
|
<view class="" v-if='item.status==2' style="font-size: 24rpx; color: #777777;">
|
||||||
|
备注:{{item.fail_msg}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<u-button v-if="showBtn" @click="openApplet" color="#3ABD40" shape="circle" text="立即发布产品"></u-button>
|
||||||
|
|
||||||
|
|
||||||
<view class="application-record" v-if="listData.length">
|
<view class="application-record" v-if="listData.length">
|
||||||
<view class="card-list" v-for="item in listData" :key="item.mer_intention_id">
|
<!-- <view class="card-list" v-for="item in listData" :key="item.mer_intention_id">
|
||||||
<view class="card-top">
|
<view class="card-top">
|
||||||
<view class="title">{{item.mer_name}}</view>
|
<view class="title">{{item.mer_name}}</view>
|
||||||
<view class="time">提交时间:{{item.create_time}}</view>
|
<view class="time">提交时间:{{item.create_time}}</view>
|
||||||
@ -17,7 +60,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="status-btn" @click="jump(item)">{{statusBtn(item.status)}}</view>
|
<view class="status-btn" @click="jump(item)">{{statusBtn(item.status)}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class='no-shop' v-if="!listData.length && !loading">
|
<view class='no-shop' v-if="!listData.length && !loading">
|
||||||
<view class='pictrue' style="margin: 0 auto;">
|
<view class='pictrue' style="margin: 0 auto;">
|
||||||
@ -39,15 +82,22 @@
|
|||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import {
|
import {
|
||||||
getApplicationRecordList
|
getApplicationRecordList,
|
||||||
|
getUnimpInfo
|
||||||
} from '@/api/store.js'
|
} from '@/api/store.js'
|
||||||
import {HTTP_REQUEST_URL} from '@/config/app';
|
import {
|
||||||
|
HTTP_REQUEST_URL
|
||||||
|
} from '@/config/app';
|
||||||
|
|
||||||
|
import uniMP from '@/utils/uniMP.js';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
domain: HTTP_REQUEST_URL,
|
domain: HTTP_REQUEST_URL,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
showBtn: false,
|
||||||
listData: [],
|
listData: [],
|
||||||
|
uniMpInfo: {},
|
||||||
pageData: {
|
pageData: {
|
||||||
page: 1,
|
page: 1,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
@ -71,6 +121,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
openApplet() {
|
||||||
|
this.uniMpInfo.showToast = true
|
||||||
|
uniMP.loadAppletMP(this.uniMpInfo)
|
||||||
|
},
|
||||||
getListData() {
|
getListData() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
@ -79,8 +133,23 @@
|
|||||||
getApplicationRecordList(this.pageData).then(res => {
|
getApplicationRecordList(this.pageData).then(res => {
|
||||||
this.count = res.data.count
|
this.count = res.data.count
|
||||||
this.listData = this.listData.concat(res.data.list)
|
this.listData = this.listData.concat(res.data.list)
|
||||||
|
this.showBtn = (this.listData[this.listData.length - 1].status == 1)
|
||||||
|
if (this.showBtn) {
|
||||||
|
getUnimpInfo().then(res => {
|
||||||
|
this.uniMpInfo = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
}).catch(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
navgo() {
|
||||||
|
// uni.navigateBack()
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/store/settled/index?type=1'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 跳转逻辑
|
// 跳转逻辑
|
||||||
@ -127,72 +196,20 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #F5F5F5;
|
background-color: #F5F5F5;
|
||||||
padding: 20rpx 30rpx;
|
padding: 20rpx 30rpx;
|
||||||
.card-list {
|
|
||||||
width: 100%;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 20rpx 24rpx;
|
|
||||||
margin: 10rpx 20rpx;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
.card-top {
|
|
||||||
height: 140rpx;
|
|
||||||
.title {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
.time {
|
|
||||||
color: #999999;
|
|
||||||
font-size: 24rpx;
|
|
||||||
padding: 5rpx 0;
|
|
||||||
}
|
|
||||||
.reason {
|
|
||||||
color: #E93323;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.line {
|
|
||||||
height: 2rpx;
|
|
||||||
margin: 20rpx 0 20rpx 0;
|
|
||||||
background-color: #EEEEEE;
|
|
||||||
}
|
|
||||||
.card-bottom {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
color: #333;
|
|
||||||
.card-status {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
.status-icon {
|
|
||||||
width: 30rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
margin: 10rpx;
|
|
||||||
}
|
|
||||||
.status-text {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.status-btn {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #555;
|
|
||||||
border: 1px solid #999999;
|
|
||||||
padding: 8rpx 32rpx;
|
|
||||||
border-radius: 40rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-shop {
|
.no-shop {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|
||||||
.pictrue {
|
.pictrue {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: $uni-nothing-text;
|
color: $uni-nothing-text;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 414rpx;
|
width: 414rpx;
|
||||||
height: 380rpx;
|
height: 380rpx;
|
||||||
|
1805
pages/store/settled/index1.vue
Normal file
@ -176,11 +176,11 @@
|
|||||||
<view class="user-menus" style="margin-top: 20rpx;">
|
<view class="user-menus" style="margin-top: 20rpx;">
|
||||||
<view class="title skeleton-rect">我的服务</view>
|
<view class="title skeleton-rect">我的服务</view>
|
||||||
<view class="menu-box">
|
<view class="menu-box">
|
||||||
<block v-for="(item,index) in personalMenu" :key="index">
|
<block v-for="(item,index) in personalMenu" :key="index" :id="'target'+index">
|
||||||
<view v-if="item.isShow" class="item ">
|
<view v-if="item.isShow" class="item ">
|
||||||
<view @click="authTo(item.url)" class="item-count">
|
<view @click="authTo(item.url,item.name)" class="item-count">
|
||||||
<image v-if="showSkeleton" class="skeleton_image skeleton-radius"></image>
|
<image v-if="showSkeleton" class="skeleton_image skeleton-radius"></image>
|
||||||
<image v-else :src="item.pic"></image>
|
<image v-else :src="item.pic" class="targets"></image>
|
||||||
<text>{{item.name}}</text>
|
<text>{{item.name}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -333,9 +333,11 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
elInfo: '',
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
isWeixin: this.$wechat.isWeixin(),
|
isWeixin: this.$wechat.isWeixin(),
|
||||||
//#endif
|
//#endif
|
||||||
|
subNvue: '',
|
||||||
domain: HTTP_REQUEST_URL,
|
domain: HTTP_REQUEST_URL,
|
||||||
showSkeleton: true, //骨架屏显示隐藏
|
showSkeleton: true, //骨架屏显示隐藏
|
||||||
isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
|
isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
|
||||||
@ -460,6 +462,9 @@
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
|
uni.$on('offuserSubnvue', () => {
|
||||||
|
this.subNvue.hide('slide-out-right');
|
||||||
|
})
|
||||||
this.appVersion = 'V ' + uni.getSystemInfoSync().appWgtVersion;
|
this.appVersion = 'V ' + uni.getSystemInfoSync().appWgtVersion;
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
@ -468,12 +473,52 @@
|
|||||||
if (ENV != 'prod') this.appVersion += " Beta"
|
if (ENV != 'prod') this.appVersion += " Beta"
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
|
// #ifdef APP
|
||||||
this.isNodes++;
|
this.isNodes++;
|
||||||
|
let that = this
|
||||||
|
// setTimeout(() => {
|
||||||
|
// const query = uni.createSelectorQuery().in(this);
|
||||||
|
// query
|
||||||
|
// .select(".targets")
|
||||||
|
// .boundingClientRect((data) => {
|
||||||
|
// that.elInfo = data
|
||||||
|
// // #ifdef APP-PLUS
|
||||||
|
// if (Boolean(uni.getStorageSync('newStore'))) {
|
||||||
|
// that.subNvue = uni.getSubNVueById('userSubnvu')
|
||||||
|
// that.subNvue.show('slide-in-left', 300)
|
||||||
|
// uni.$emit('openUserSubnvue', JSON.stringify(data))
|
||||||
|
// }
|
||||||
|
// // #endif
|
||||||
|
// })
|
||||||
|
// .exec();
|
||||||
|
// }, 500)
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
this.getVersion()
|
this.getVersion()
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
setTimeout(() => {
|
||||||
|
const query = uni.createSelectorQuery().in(this);
|
||||||
|
query
|
||||||
|
.select(".targets")
|
||||||
|
.boundingClientRect((data) => {
|
||||||
|
that.elInfo = data
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (Boolean(uni.getStorageSync('newStore'))) {
|
||||||
|
that.subNvue = uni.getSubNVueById('userSubnvu')
|
||||||
|
that.subNvue.show('slide-in-left', 300)
|
||||||
|
uni.$emit('openUserSubnvue', JSON.stringify(data))
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
.exec();
|
||||||
|
}, 800)
|
||||||
|
// #endif
|
||||||
let that = this;
|
let that = this;
|
||||||
let routes = getCurrentPages();
|
let routes = getCurrentPages();
|
||||||
let curRoute = routes[routes.length - 1].route
|
let curRoute = routes[routes.length - 1].route
|
||||||
@ -496,10 +541,16 @@
|
|||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
authTo(url) {
|
authTo(url, name) {
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
|
let txt = "";
|
||||||
|
if (this.userInfo && this.userInfo.service && name == "商家入驻") {
|
||||||
|
txt = url + '?step=3'
|
||||||
|
} else {
|
||||||
|
txt = url;
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url
|
url: txt
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.openAuto()
|
this.openAuto()
|
||||||
|
179
pages/user/subnvue/index.nvue
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
<template>
|
||||||
|
<view class="">
|
||||||
|
<view class="jump" @click="next">
|
||||||
|
<text class="font">跳过</text>
|
||||||
|
</view>
|
||||||
|
<view class="next-btn center" :style="{ left:screenWidth/2,top:(screenHeight-96)}">
|
||||||
|
<text class="next-btn-text font" style="line-height: 76rpx;" @click="next">我知道了</text>
|
||||||
|
</view>
|
||||||
|
<view class="target" :style="{left:left-20,top:top-13.5}">
|
||||||
|
<image src="http://lihai001.oss-cn-chengdu.aliyuncs.com/def/6202d269b6163b9ec7a4383559fc67a8.png"
|
||||||
|
class="target-icon"></image>
|
||||||
|
<text class="target-text">商家入驻</text>
|
||||||
|
</view>
|
||||||
|
<view :style="{left:left-20+'px',top:top-70+'px'}" class="trans1">
|
||||||
|
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;"></image>
|
||||||
|
</view>
|
||||||
|
<view class="tips-box" :style="{left:left-13.5,top:top-154}">
|
||||||
|
<view class="tips" style="position: absolute;padding-left: 20px;">
|
||||||
|
<view class="tras" :class="{act:isAct}">
|
||||||
|
<text style="font-size: 28rpx;line-height: 100rpx;color: white;">点击商户入驻,轻松开店</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image src="/static/images/starpng.png" class="start" mode="">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
<image src="/static/images/greenLine.png" class="greenLine" :style="{left:left-3.5,top:top-70}" mode="">
|
||||||
|
</image>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
screenHeight: 0,
|
||||||
|
screenWidth: 0,
|
||||||
|
isAct: false,
|
||||||
|
left: -100,
|
||||||
|
top: -100,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
next() {
|
||||||
|
uni.$emit('offuserSubnvue');
|
||||||
|
uni.setStorageSync("newStore", false)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
let that = this
|
||||||
|
uni.$on('openUserSubnvue', (data) => {
|
||||||
|
console.log('data')
|
||||||
|
console.log(data)
|
||||||
|
this.left = JSON.parse(data).left
|
||||||
|
this.top = JSON.parse(data).top
|
||||||
|
console.log(this.left, this.top)
|
||||||
|
})
|
||||||
|
const res = uni.getSystemInfo({
|
||||||
|
success: (res => {
|
||||||
|
this.screenHeight = res.screenHeight
|
||||||
|
this.screenWidth = res.screenWidth
|
||||||
|
|
||||||
|
})
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
that.isAct = true
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.jump {
|
||||||
|
position: absolute;
|
||||||
|
right: 30rpx;
|
||||||
|
top: 80rpx;
|
||||||
|
border: 1px solid white;
|
||||||
|
padding: 10rpx 20rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: white;
|
||||||
|
lines: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.next-btn {
|
||||||
|
position: absolute;
|
||||||
|
width: 240rpx;
|
||||||
|
height: 76rpx;
|
||||||
|
border: 1px solid white;
|
||||||
|
border-radius: 38rpx;
|
||||||
|
background: rgba(255, 255, 255, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.target {
|
||||||
|
width: 136rpx;
|
||||||
|
height: 136rpx;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 136rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.target-icon {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 68rpx;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
top: 68rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.target-text {
|
||||||
|
font-size: 20rpx;
|
||||||
|
position: absolute;
|
||||||
|
left: 68rpx;
|
||||||
|
transform: translate(-50%, 0);
|
||||||
|
top: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pointer {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips-box {
|
||||||
|
width: 462rpx;
|
||||||
|
height: 178rpx;
|
||||||
|
position: absolute;
|
||||||
|
padding-top: 72rpx;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.start {
|
||||||
|
width: 72rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
width: 462rpx;
|
||||||
|
height: 106rpx;
|
||||||
|
background-color: #5BE157;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.tras {
|
||||||
|
width: 0px;
|
||||||
|
transition-property: width;
|
||||||
|
transition-duration: 3s;
|
||||||
|
transition-delay: 0.1s;
|
||||||
|
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.trans1 {
|
||||||
|
/* transition-property: left, top;
|
||||||
|
transition-duration: 3s;
|
||||||
|
transition-delay: 0.1s;
|
||||||
|
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0); */
|
||||||
|
}
|
||||||
|
|
||||||
|
.act {
|
||||||
|
width: 462rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.greenLine {
|
||||||
|
width: 35px;
|
||||||
|
height: 60px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :style="viewColor">
|
<div :style="viewColor">
|
||||||
<div class="register_main" :style="{ 'background-image': formItem == 1 ? `url(${domain}/static/images/logo_bgl.png)` : `url(${domain}/static/images/logo_bgh.png)`}">
|
<div class="register_main"
|
||||||
|
:style="{ 'background-image': formItem == 1 ? `url(${domain}/static/images/logo_bgl.png)` : `url(${domain}/static/images/logo_bgh.png)`}">
|
||||||
<view class="system-height" :style="{ height: statusBarHeight }"></view>
|
<view class="system-height" :style="{ height: statusBarHeight }"></view>
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view class="title-bar" style="height: 43px;">
|
<view class="title-bar" style="height: 43px;">
|
||||||
@ -21,12 +22,15 @@
|
|||||||
<div class="list" :hidden="current !== 0">
|
<div class="list" :hidden="current !== 0">
|
||||||
<form @submit.prevent="submit">
|
<form @submit.prevent="submit">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<input type="text" placeholder="请输入手机号或账号" placeholder-class="placeholder" v-model="account" required />
|
<input type="text" placeholder="请输入手机号或账号" placeholder-class="placeholder"
|
||||||
|
v-model="account" required />
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<input type="password" placeholder="填写登录密码" placeholder-class="placeholder" v-model="password" required />
|
<input type="password" placeholder="填写登录密码" placeholder-class="placeholder"
|
||||||
<navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
|
v-model="password" required />
|
||||||
忘记密码
|
<navigator class="forgetPwd" hover-class="none"
|
||||||
|
url="/pages/users/retrievePassword/index">
|
||||||
|
忘记密we码
|
||||||
</navigator>
|
</navigator>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -37,8 +41,10 @@
|
|||||||
<input type="text" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" />
|
<input type="text" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" />
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" v-model="captcha" />
|
<input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput"
|
||||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="handleVerify">
|
v-model="captcha" />
|
||||||
|
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
||||||
|
@click="handleVerify">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -53,7 +59,9 @@
|
|||||||
<div class="protocol acea-row row-between-wrapper">
|
<div class="protocol acea-row row-between-wrapper">
|
||||||
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
||||||
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
||||||
<text class="protocol_text">我已同意<text @click="userAgree" class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree" class="font_pro">《隐私政策》</text></text>
|
<text class="protocol_text">我已同意<text @click="userAgree"
|
||||||
|
class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree"
|
||||||
|
class="font_pro">《隐私政策》</text></text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
@ -83,17 +91,23 @@
|
|||||||
<input type="text" placeholder="请输入手机号" placeholder-class="placeholder" v-model="account" />
|
<input type="text" placeholder="请输入手机号" placeholder-class="placeholder" v-model="account" />
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" v-model="captcha" />
|
<input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput"
|
||||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="handleVerify">
|
v-model="captcha" />
|
||||||
|
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
||||||
|
@click="handleVerify">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<input type="password" placeholder="填写您的登录密码" placeholder-class="placeholder" v-model="password" />
|
<input type="password" placeholder="填写您的登录密码" placeholder-class="placeholder"
|
||||||
|
v-model="password" />
|
||||||
</div>
|
</div>
|
||||||
<div class="item" v-if="isShowCode">
|
<div class="item" v-if="isShowCode">
|
||||||
<input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput" v-model="codeVal" />
|
<input type="text" placeholder="填写验证码" placeholder-class="placeholder" class="codeIput"
|
||||||
<div class="code" @click="getcaptcha"><image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" /></div>
|
v-model="codeVal" />
|
||||||
|
<div class="code" @click="getcaptcha">
|
||||||
|
<image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tip">
|
<div class="tip">
|
||||||
@ -104,7 +118,9 @@
|
|||||||
<div class="protocol acea-row row-between-wrapper">
|
<div class="protocol acea-row row-between-wrapper">
|
||||||
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
||||||
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
||||||
<text class="protocol_text">我已同意<text @click="userAgree" class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree" class="font_pro">《隐私政策》</text></text>
|
<text class="protocol_text">我已同意<text @click="userAgree"
|
||||||
|
class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree"
|
||||||
|
class="font_pro">《隐私政策》</text></text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
@ -135,21 +151,27 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<input type='number' placeholder='填写手机号码' placeholder-class='placeholder' v-model="account"></input>
|
<input type='number' placeholder='填写手机号码' placeholder-class='placeholder'
|
||||||
|
v-model="account"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<input type='number' placeholder='填写验证码' placeholder-class='placeholder' class="codeIput" v-model="captcha"></input>
|
<input type='number' placeholder='填写验证码' placeholder-class='placeholder'
|
||||||
<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled' @click="handleVerify">
|
class="codeIput" v-model="captcha"></input>
|
||||||
|
<button class="code" :class="disabled === true ? 'on' : ''" :disabled='disabled'
|
||||||
|
@click="handleVerify">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<input type='password' placeholder='填写登录密码' placeholder-class='placeholder' v-model="password"></input>
|
<input type='password' placeholder='填写登录密码' placeholder-class='placeholder'
|
||||||
|
v-model="password"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="protocol acea-row">
|
<view class="protocol acea-row">
|
||||||
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
||||||
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
||||||
<text class="protocol_text">您已同意<text @click="userAgree" class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree" class="font_pro">《隐私政策》</text></text>
|
<text class="protocol_text">您已同意<text @click="userAgree"
|
||||||
|
class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree"
|
||||||
|
class="font_pro">《隐私政策》</text></text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -160,7 +182,8 @@
|
|||||||
|
|
||||||
</form>
|
</form>
|
||||||
<view class="copyright" @click="goCopyUrl">{{copyData}}</view>
|
<view class="copyright" @click="goCopyUrl">{{copyData}}</view>
|
||||||
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
|
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
|
||||||
|
ref="verify"></Verify>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -190,7 +213,10 @@
|
|||||||
loginMpPhone
|
loginMpPhone
|
||||||
} from "@/api/user";
|
} from "@/api/user";
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
import { wechatAppAuth, appleAppAuth } from '@/api/api.js'
|
import {
|
||||||
|
wechatAppAuth,
|
||||||
|
appleAppAuth
|
||||||
|
} from '@/api/api.js'
|
||||||
// #endif
|
// #endif
|
||||||
import attrs, {
|
import attrs, {
|
||||||
required,
|
required,
|
||||||
@ -209,10 +235,16 @@
|
|||||||
VUE_APP_API_URL,
|
VUE_APP_API_URL,
|
||||||
configMap
|
configMap
|
||||||
} from "@/utils";
|
} from "@/utils";
|
||||||
import { HTTP_REQUEST_URL } from '@/config/app';
|
import {
|
||||||
|
HTTP_REQUEST_URL
|
||||||
|
} from '@/config/app';
|
||||||
import parser from "@/components/jyf-parser/jyf-parser";
|
import parser from "@/components/jyf-parser/jyf-parser";
|
||||||
import { commonAuth } from '../../../api/public';
|
import {
|
||||||
import { mapGetters} from "vuex";
|
commonAuth
|
||||||
|
} from '../../../api/public';
|
||||||
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
import Verify from '@/components/verify/verify.vue';
|
import Verify from '@/components/verify/verify.vue';
|
||||||
const BACK_URL = "login_back_url";
|
const BACK_URL = "login_back_url";
|
||||||
|
|
||||||
@ -256,7 +288,8 @@
|
|||||||
computed: {
|
computed: {
|
||||||
...configMap(['login_logo', 'wechat_phone_switch'], mapGetters(['viewColor'])),
|
...configMap(['login_logo', 'wechat_phone_switch'], mapGetters(['viewColor'])),
|
||||||
copyData() {
|
copyData() {
|
||||||
let copy = this.copyright.status == -1 ? this.copyright.year+" "+this.copyright.url : this.copyright.Copyright
|
let copy = this.copyright.status == -1 ? this.copyright.year + " " + this.copyright.url : this.copyright
|
||||||
|
.Copyright
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -326,7 +359,8 @@
|
|||||||
that.$store.commit('UPDATE_USERINFO', data.user);
|
that.$store.commit('UPDATE_USERINFO', data.user);
|
||||||
|
|
||||||
let method
|
let method
|
||||||
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', '/pages/goods_cate/goods_cate',
|
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
|
||||||
|
'/pages/goods_cate/goods_cate',
|
||||||
'/pages/user/index', '/pages/plant_grass/index'
|
'/pages/user/index', '/pages/plant_grass/index'
|
||||||
]
|
]
|
||||||
if (indexPat.includes(this.getPath(backUrl))) {
|
if (indexPat.includes(this.getPath(backUrl))) {
|
||||||
@ -439,9 +473,11 @@
|
|||||||
auth: {
|
auth: {
|
||||||
userInfo: that.appleUserInfo,
|
userInfo: that.appleUserInfo,
|
||||||
openId: that.appleUserInfo.openId,
|
openId: that.appleUserInfo.openId,
|
||||||
nickname: (that.appleUserInfo.fullName.familyName || '') + (that.appleUserInfo.fullName.giveName || ''),
|
nickname: (that.appleUserInfo.fullName.familyName || '') + (that.appleUserInfo.fullName
|
||||||
|
.giveName || ''),
|
||||||
}
|
}
|
||||||
}}).then(res => {
|
}
|
||||||
|
}).then(res => {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
if (res.data.status == 200) {
|
if (res.data.status == 200) {
|
||||||
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||||
@ -453,7 +489,8 @@
|
|||||||
that.$store.commit("SETUID", data.result.user.uid);
|
that.$store.commit("SETUID", data.result.user.uid);
|
||||||
that.$store.commit('UPDATE_USERINFO', data.result.user);
|
that.$store.commit('UPDATE_USERINFO', data.result.user);
|
||||||
let method
|
let method
|
||||||
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', '/pages/goods_cate/goods_cate',
|
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
|
||||||
|
'/pages/goods_cate/goods_cate',
|
||||||
'/pages/user/index', '/pages/plant_grass/index'
|
'/pages/user/index', '/pages/plant_grass/index'
|
||||||
]
|
]
|
||||||
if (indexPat.includes(this.getPath(backUrl))) {
|
if (indexPat.includes(this.getPath(backUrl))) {
|
||||||
@ -527,7 +564,8 @@
|
|||||||
openid: that.appUserInfo.authResult.openid,
|
openid: that.appUserInfo.authResult.openid,
|
||||||
phone: this.account,
|
phone: this.account,
|
||||||
}
|
}
|
||||||
}}).then(res => {
|
}
|
||||||
|
}).then(res => {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
if (res.data.status == 200) {
|
if (res.data.status == 200) {
|
||||||
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
const backUrl = that.$Cache.get(BACK_URL) || "/pages/index/index";
|
||||||
@ -539,7 +577,8 @@
|
|||||||
that.$store.commit("SETUID", data.result.user.uid);
|
that.$store.commit("SETUID", data.result.user.uid);
|
||||||
that.$store.commit('UPDATE_USERINFO', data.result.user);
|
that.$store.commit('UPDATE_USERINFO', data.result.user);
|
||||||
let method
|
let method
|
||||||
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', '/pages/goods_cate/goods_cate',
|
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
|
||||||
|
'/pages/goods_cate/goods_cate',
|
||||||
'/pages/user/index', '/pages/plant_grass/index'
|
'/pages/user/index', '/pages/plant_grass/index'
|
||||||
]
|
]
|
||||||
if (indexPat.includes(this.getPath(backUrl))) {
|
if (indexPat.includes(this.getPath(backUrl))) {
|
||||||
@ -632,7 +671,8 @@
|
|||||||
that.$store.commit('UPDATE_USERINFO', data.user);
|
that.$store.commit('UPDATE_USERINFO', data.user);
|
||||||
|
|
||||||
let method
|
let method
|
||||||
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', '/pages/goods_cate/goods_cate',
|
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
|
||||||
|
'/pages/goods_cate/goods_cate',
|
||||||
'/pages/user/index'
|
'/pages/user/index'
|
||||||
]
|
]
|
||||||
if (indexPat.includes(this.getPath(backUrl))) {
|
if (indexPat.includes(this.getPath(backUrl))) {
|
||||||
@ -792,7 +832,8 @@
|
|||||||
that.$store.commit('UPDATE_USERINFO', data.user);
|
that.$store.commit('UPDATE_USERINFO', data.user);
|
||||||
|
|
||||||
let method
|
let method
|
||||||
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart', '/pages/goods_cate/goods_cate',
|
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
|
||||||
|
'/pages/goods_cate/goods_cate',
|
||||||
'/pages/user/index'
|
'/pages/user/index'
|
||||||
]
|
]
|
||||||
if (indexPat.includes(this.getPath(backUrl))) {
|
if (indexPat.includes(this.getPath(backUrl))) {
|
||||||
@ -848,11 +889,13 @@
|
|||||||
width: 28rpx;
|
width: 28rpx;
|
||||||
height: 28rpx;
|
height: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked,
|
/deep/checkbox .uni-checkbox-input.uni-checkbox-input-checked,
|
||||||
/deep/checkbox .wx-checkbox-input.wx-checkbox-input-checked {
|
/deep/checkbox .wx-checkbox-input.wx-checkbox-input-checked {
|
||||||
border: 1px solid var(--view-theme) !important;
|
border: 1px solid var(--view-theme) !important;
|
||||||
background-color: var(--view-theme) !important;
|
background-color: var(--view-theme) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ChangePassword .phone {
|
.ChangePassword .phone {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@ -876,18 +919,23 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ChangePassword .list .item .placeholder {
|
.ChangePassword .list .item .placeholder {
|
||||||
color: #bbbbbb;
|
color: #bbbbbb;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ChangePassword .list .item input.codeIput {
|
.ChangePassword .list .item input.codeIput {
|
||||||
width: 240rpx;
|
width: 240rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register .whiteBg .title_info text {
|
.register .whiteBg .title_info text {
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
.register .list .item .code {
|
.register .list .item .code {
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-bar {
|
.title-bar {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -897,6 +945,7 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
line-height: 48rpx;
|
line-height: 48rpx;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 30rpx;
|
left: 30rpx;
|
||||||
@ -906,6 +955,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 50rpx;
|
width: 50rpx;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
@ -923,15 +973,18 @@
|
|||||||
margin: 40rpx auto 0 auto;
|
margin: 40rpx auto 0 auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 90rpx;
|
line-height: 90rpx;
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
margin-right: 12rpx;
|
margin-right: 12rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.code image {
|
.code image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settlementAgreement {
|
.settlementAgreement {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@ -941,41 +994,50 @@
|
|||||||
background: rgba(0, 0, 0, .5);
|
background: rgba(0, 0, 0, .5);
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
.protocol_text {
|
.protocol_text {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.protocol {
|
.protocol {
|
||||||
margin-top: 82rpx;
|
margin-top: 82rpx;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.protocol_text {
|
.protocol_text {
|
||||||
.font_pro {
|
.font_pro {
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.appLogin {
|
.appLogin {
|
||||||
margin-top: 82rpx;
|
margin-top: 82rpx;
|
||||||
|
|
||||||
.hds {
|
.hds {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #B4B4B4;
|
color: #B4B4B4;
|
||||||
|
|
||||||
.line {
|
.line {
|
||||||
width: 68rpx;
|
width: 68rpx;
|
||||||
height: 1rpx;
|
height: 1rpx;
|
||||||
background: #CCCCCC;
|
background: #CCCCCC;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin: 0 20rpx;
|
margin: 0 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-wrapper {
|
.btn-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -983,10 +1045,12 @@
|
|||||||
width: 68rpx;
|
width: 68rpx;
|
||||||
height: 68rpx;
|
height: 68rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
|
|
||||||
+.btn {
|
+.btn {
|
||||||
margin-left: 30rpx;
|
margin-left: 30rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.apple-btn {
|
.apple-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -997,31 +1061,38 @@
|
|||||||
background: #EAEAEA;
|
background: #EAEAEA;
|
||||||
border-radius: 34rpx;
|
border-radius: 34rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
|
||||||
.icon-s-pingguo {
|
.icon-s-pingguo {
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-right: 10rpx;
|
margin-right: 10rpx;
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wx {
|
.wx {
|
||||||
background-color: #61C64F;
|
background-color: #61C64F;
|
||||||
|
|
||||||
&.btn-apple {
|
&.btn-apple {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mima {
|
.mima {
|
||||||
background-color: #28B3E9;
|
background-color: #28B3E9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.yanzheng {
|
.yanzheng {
|
||||||
background-color: #F89C23;
|
background-color: #F89C23;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.whiteBg .logon {
|
.whiteBg .logon {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -1034,14 +1105,17 @@
|
|||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.whiteBg .back {
|
.whiteBg .back {
|
||||||
border: 1px solid var(--view-theme);
|
border: 1px solid var(--view-theme);
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
margin-top: 30rpx;
|
margin-top: 30rpx;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-wrapper {
|
.login-wrapper {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
|
|
||||||
.shading {
|
.shading {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -1052,6 +1126,7 @@
|
|||||||
/* #endif */
|
/* #endif */
|
||||||
/* #ifndef APP-VUE */
|
/* #ifndef APP-VUE */
|
||||||
margin-top: 200rpx;
|
margin-top: 200rpx;
|
||||||
|
|
||||||
/* #endif */
|
/* #endif */
|
||||||
image {
|
image {
|
||||||
width: 180rpx;
|
width: 180rpx;
|
||||||
@ -1059,6 +1134,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.copyright {
|
.copyright {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 30rpx;
|
bottom: 30rpx;
|
||||||
|
@ -1,117 +1,120 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :style="viewColor">
|
<view :style="viewColor">
|
||||||
|
<view class="register absolute" v-if="!auth_token">
|
||||||
<div class="register absolute" v-if="!auth_token">
|
<!-- <view class="login" style="background-size: 100% 100%;background-repeat: no-repeat;"> -->
|
||||||
<div class="login" style="background-size: 100% 100%;background-repeat: no-repeat;">
|
<view class="login">
|
||||||
<div class="shading">
|
<view class="shading">
|
||||||
<div class="pictrue acea-row row-center-wrapper" style="background-color: transparent !important;">
|
<view class="pictrue acea-row row-center-wrapper" style="background-color: transparent !important;">
|
||||||
<image src="@/static/images/logo1.png" />
|
<image src="@/static/images/logo1.png" />
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="whiteBg" v-if="formItem == 0">
|
<view class="" style="margin-top: 10rpx;" v-if='formItem==2'>
|
||||||
<div class="logon" style="display: flex;align-items: center;justify-content: center;"
|
<view style="text-align: center;font-size: 36rpx;color: #20B128;font-weight: 700;">
|
||||||
|
重置密码
|
||||||
|
</view>
|
||||||
|
<view style="text-align: center;color: #BCBCBC;font-size: 24rpx;margin-top: 10rpx;">
|
||||||
|
请输入手机号码和验证码找回密码、重置
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="whiteBg" v-if="formItem == 0">
|
||||||
|
<view class="logon" style="display: flex;align-items: center;justify-content: center;"
|
||||||
@click="wxLogin">
|
@click="wxLogin">
|
||||||
<u-icon name="weixin-fill" color="#fff" size="30"></u-icon> 微信一键登录
|
<u-icon name="weixin-fill" color="#fff" size="30"></u-icon> 微信一键登录
|
||||||
</div>
|
</view>
|
||||||
|
|
||||||
<div class="protocol acea-row row-between-wrapper">
|
<view class="protocol acea-row row-between-wrapper">
|
||||||
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
||||||
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
||||||
<text class="protocol_text">我已同意<text @click="userAgree"
|
<text class="protocol_text">我已同意<text @click="userAgree"
|
||||||
class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree"
|
class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree"
|
||||||
class="font_pro">《隐私政策》</text></text>
|
class="font_pro">《隐私政策》</text></text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="whiteBg" v-else-if="formItem === 1" style="po">
|
<view class="whiteBg" v-else-if="formItem === 1">
|
||||||
<div class="title acea-row row-center-wrapper">
|
<view class="title acea-row row-center-wrapper">
|
||||||
<div class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
|
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
|
||||||
@click="navTap(index)" :key="index">
|
@click="navTap(index)" :key="index">
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="list" :hidden="current !== 1">
|
<view class="list" :hidden="current !== 1">
|
||||||
<form @submit.prevent="submit">
|
<form @submit.prevent="submit">
|
||||||
<div class="item">
|
<view class="item">
|
||||||
<div class="acea-row row-middle">
|
<view class="acea-row row-middle">
|
||||||
<image src="/static/images/phone_1.png"></image>
|
<image src="/static/images/phone_1.png"></image>
|
||||||
<input type="number" placeholder="输入账号" placeholder-class="placeholder"
|
<input type="number" placeholder="输入账号" placeholder-class="placeholder"
|
||||||
v-model="account" required />
|
v-model="account" required />
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="item">
|
<view class="item">
|
||||||
<div class="acea-row row-middle">
|
<view class="acea-row row-middle">
|
||||||
<image src="/static/images/code_2.png"></image>
|
<image v-if="type1" @click="type1=false" src="/static/images/eye.png"></image>
|
||||||
<input type="password" placeholder="填写登录密码" placeholder-class="placeholder"
|
<image v-else @click="type1=true" src="/static/images/offeye.png"></image>
|
||||||
v-model="password" required />
|
<input style="border: none; outline:none;outline:0" :type="type1?'password':'input'"
|
||||||
</div>
|
placeholder="填写登录密码" placeholder-class="placeholder" v-model="password"
|
||||||
</div>
|
required />
|
||||||
</form>
|
<button class="code" @click="formItem=2">
|
||||||
<div class="tip">
|
|
||||||
<!-- <span @click="formItem = 2" class="font-color-red">立即注册</span> -->
|
|
||||||
<span> </span>
|
|
||||||
<navigator class="forgetPwd" hover-class="none" url="/pages/users/retrievePassword/index">
|
|
||||||
忘记密码
|
忘记密码
|
||||||
</navigator>
|
</button>
|
||||||
</div>
|
</view>
|
||||||
|
</view>
|
||||||
</div>
|
</form>
|
||||||
<div class="list" :hidden="current !== 0">
|
</view>
|
||||||
<div class="item">
|
<view class="list" :hidden="current !== 0">
|
||||||
<div class="acea-row row-middle">
|
<view class="item">
|
||||||
|
<view class="acea-row row-middle">
|
||||||
<image src="/static/images/phone_1.png"></image>
|
<image src="/static/images/phone_1.png"></image>
|
||||||
<input type="number" placeholder="输入手机号码" placeholder-class="placeholder"
|
<input type="number" placeholder="输入手机号码" placeholder-class="placeholder"
|
||||||
v-model="account" />
|
v-model="account" />
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
|
<view class="item">
|
||||||
<div class="item">
|
<view class="acea-row row-middle">
|
||||||
<div class="acea-row row-middle">
|
|
||||||
<image src="/static/images/code_2.png"></image>
|
<image src="/static/images/code_2.png"></image>
|
||||||
|
|
||||||
<input type="number" placeholder="填写验证码" placeholder-class="placeholder"
|
<input type="number" placeholder="填写验证码" placeholder-class="placeholder"
|
||||||
class="codeIput" v-model="captcha" maxlength="4" />
|
class="codeIput" v-model="captcha" maxlength="4" />
|
||||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''"
|
||||||
@click="handleVerify">
|
@click="handleVerify">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="item" v-if="isShowCode">
|
<view class="item" v-if="isShowCode">
|
||||||
<div class="acea-row row-middle">
|
<view class="acea-row row-middle">
|
||||||
<image src="/static/images/code_2.png"></image>
|
<image src="/static/images/code_2.png"></image>
|
||||||
<input type="number" placeholder="填写验证码" placeholder-class="placeholder"
|
<input type="number" placeholder="填写验证码" placeholder-class="placeholder"
|
||||||
class="codeIput" v-model="codeVal" maxlength="4" />
|
class="codeIput" v-model="codeVal" maxlength="4" />
|
||||||
<div class="code" @click="getcaptcha">
|
<view class="code" @click="getcaptcha">
|
||||||
<image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" />
|
<image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" />
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
|
|
||||||
<div class="logon" @click="loginMobile" :hidden="current !== 0">登录</div>
|
<view class="logon" @click="loginMobile" :hidden="current !== 0">登录</view>
|
||||||
<div class="logon" @click="submit" :hidden="current === 0">登录</div>
|
<view class="logon" @click="submit" :hidden="current === 0">账号登录</view>
|
||||||
<div class="protocol acea-row row-between-wrapper">
|
<view class="protocol acea-row row-between-wrapper">
|
||||||
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
||||||
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
||||||
<text class="protocol_text">我已同意<text @click="userAgree"
|
<text class="protocol_text">我已同意<text @click="userAgree"
|
||||||
class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree"
|
class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree"
|
||||||
class="font_pro">《隐私政策》</text></text>
|
class="font_pro">《隐私政策》</text></text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="whiteBg" v-else>
|
|
||||||
<div class="title">注册账号</div>
|
<view class="whiteBg" style="margin-top: 0;" v-else-if='formItem==2'>
|
||||||
<div class="list">
|
<view class="list">
|
||||||
<div class="item">
|
<view class="item">
|
||||||
<div class="acea-row row-middle">
|
<view class="acea-row row-middle">
|
||||||
<image src="/static/images/phone_1.png"></image>
|
<image src="/static/images/phone_1.png"></image>
|
||||||
<input type="number" placeholder="输入手机号码" placeholder-class="placeholder"
|
<input type="number" placeholder="输入手机号码" placeholder-class="placeholder"
|
||||||
v-model="account" />
|
v-model="account" />
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="item">
|
<view class="item">
|
||||||
<div class="acea-row row-middle">
|
<view class="acea-row row-middle">
|
||||||
<image src="/static/images/code_2.png"></image>
|
<image src="/static/images/code_2.png"></image>
|
||||||
<input type="number" placeholder="填写验证码" maxLength='4' placeholder-class="placeholder"
|
<input type="number" placeholder="填写验证码" maxLength='4' placeholder-class="placeholder"
|
||||||
class="codeIput" v-model="captcha" />
|
class="codeIput" v-model="captcha" />
|
||||||
@ -120,49 +123,64 @@
|
|||||||
@click="handleVerify">
|
@click="handleVerify">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="item">
|
<view class="item">
|
||||||
<div class="acea-row row-middle">
|
<view class="acea-row row-middle">
|
||||||
<image src="/static/images/code_1.png"></image>
|
<image v-if="type2" @click="type2=false" src="/static/images/eye.png"></image>
|
||||||
<input type="password" placeholder="填写您的登录密码" placeholder-class="placeholder"
|
<image v-else @click="type2=true" src="/static/images/offeye.png"></image>
|
||||||
|
<input :type="type2?'password':'input'" placeholder="请输入新密码"
|
||||||
|
placeholder-class="placeholder" style="border: none; outline:none;outline:0"
|
||||||
v-model="password" />
|
v-model="password" />
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="acea-row row-middle">
|
||||||
|
<image v-if="type3" @click="type3=false" src="/static/images/eye.png"></image>
|
||||||
|
<image v-else @click="type3=true" src="/static/images/offeye.png"></image>
|
||||||
|
<input :type="type3?'password':'input'" placeholder="请再次输入密码"
|
||||||
|
placeholder-class="placeholder" style="border: none; outline:none;outline:0"
|
||||||
|
v-model="confirm_pwd" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<div class="item" v-if="isShowCode">
|
<view class="item" v-if="isShowCode">
|
||||||
<div class="acea-row row-middle">
|
<view class="acea-row row-middle">
|
||||||
<image src="/static/images/code_2.png"></image>
|
<image src="/static/images/code_2.png"></image>
|
||||||
<input type="number" placeholder="填写验证码" maxlength="4" placeholder-class="placeholder"
|
<input type="number" placeholder="填写验证码" maxlength="4" placeholder-class="placeholder"
|
||||||
class="codeIput" v-model="codeVal" />
|
class="codeIput" v-model="codeVal" />
|
||||||
<div class="code" @click="getcaptcha">
|
<view class="code" @click="getcaptcha">
|
||||||
<image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" />
|
<image class="code-img" style="width: 100%;height: 100%;" :src="codeUrl" />
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
<div class="tip">
|
<view class="logon" @click="registerReset">完成并登录</view>
|
||||||
<div>
|
<view class="protocol acea-row row-between-wrapper">
|
||||||
已有账号?
|
|
||||||
<span @click="formItem = 1" class="font-color-red">去登录</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="logon" @click="register">注册</div>
|
|
||||||
<div class="protocol acea-row row-between-wrapper">
|
|
||||||
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
<checkbox-group class="checkgroup" @change='isAgree=!isAgree'>
|
||||||
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
<checkbox class="checkbox" :checked="isAgree ? true : false" />
|
||||||
<text class="protocol_text">我已同意<text @click="userAgree"
|
<text class="protocol_text">我已同意<text @click="userAgree"
|
||||||
class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree"
|
class="font_pro">《用户协议》</text>与<text @click="userPrivacyAgree"
|
||||||
class="font_pro">《隐私政策》</text></text>
|
class="font_pro">《隐私政策》</text></text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
</view>
|
||||||
</div>
|
<view class="footer-btn" v-if="formItem==2">
|
||||||
<div class="bottom"></div>
|
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;">
|
||||||
|
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text>
|
||||||
|
<text v-else @click="appOneClcik">本机一键登录</text>
|
||||||
|
</view>
|
||||||
|
<view class="login-type-btn" :class="{actLoginType:formItem==1}">
|
||||||
|
<text v-if='formItem == 0 ||formItem==2' @click="formItem = 1">更多登录方式</text>
|
||||||
|
<text v-else @click="appOneClcik">本机一键登录</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="bottom"></view>
|
||||||
<view class="settlementAgreement" v-if="showAgreement">
|
<view class="settlementAgreement" v-if="showAgreement">
|
||||||
<view class="setAgCount">
|
<view class="setAgCount">
|
||||||
<i class="icon iconfont icon-cha" @click="showAgreement = false"></i>
|
<i class="icon iconfont icon-cha" @click="showAgreement = false"></i>
|
||||||
<div class="title">用户协议与隐私政策</div>
|
<view class="title">用户协议与隐私政策</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<jyf-parser :html="agreement" ref="article" :tag-style="tagStyle"></jyf-parser>
|
<jyf-parser :html="agreement" ref="article" :tag-style="tagStyle"></jyf-parser>
|
||||||
</view>
|
</view>
|
||||||
@ -170,13 +188,18 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<div class="protocol acea-row row-between-wrapper"
|
<view class="footer-btns" v-if="formItem !=2">
|
||||||
style="position: fixed; bottom: 160rpx;left: 50%;transform: translate(-50%);">
|
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;">
|
||||||
<text class="protocol_text" v-if="formItem==0" @click="formItem = 1 ">其他方式登录</text>
|
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text>
|
||||||
<text class="protocol_text" v-else @click="formItem = 0 ">微信快捷登录</text>
|
<text v-else @click="appOneClcik">本机一键登录</text>
|
||||||
</div>
|
</view>
|
||||||
|
<view class="login-type-btn" :class="{actLoginType:formItem==1}">
|
||||||
|
<text v-if='formItem == 0 ||formItem==2' @click="formItem = 1">更多登录方式</text>
|
||||||
|
<text v-else @click="appOneClcik">本机一键登录</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</div>
|
</view>
|
||||||
<form report-submit='true' v-if="auth_token">
|
<form report-submit='true' v-if="auth_token">
|
||||||
<view class="ChangePassword">
|
<view class="ChangePassword">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
@ -215,14 +238,57 @@
|
|||||||
<button form-type="submit" @click="auth_token = ''" class="confirmBnt back">返回</button>
|
<button form-type="submit" @click="auth_token = ''" class="confirmBnt back">返回</button>
|
||||||
</view>
|
</view>
|
||||||
</form>
|
</form>
|
||||||
<!-- <view class="copyright" @click="goCopyUrl">
|
|
||||||
{{ copyright.status == -1 ? `${copyright.year} ${copyright.url}` : copyright.Copyright }}
|
|
||||||
</view> -->
|
|
||||||
|
|
||||||
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
|
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
|
||||||
ref="verify"></Verify>
|
ref="verify"></Verify>
|
||||||
|
<!-- tips弹窗 -->
|
||||||
|
<u-overlay :show="showTips">
|
||||||
|
<view class="tips">
|
||||||
|
<view class="" style="font-size: 32rpx;">
|
||||||
|
温馨提示
|
||||||
|
</view>
|
||||||
|
<block v-if="tispTile=='密码错误'">
|
||||||
|
<view class="">
|
||||||
|
{{tipsErr}}
|
||||||
|
</view>
|
||||||
|
<view class="" style="display: flex;">
|
||||||
|
<view style="width: 236rpx;height: 84rpx;margin-right:38rpx;">
|
||||||
|
<u-button plain text="找回密码" @tap="showTips=false,formItem=2"></u-button>
|
||||||
|
</view>
|
||||||
|
<view style="width: 236rpx;height: 84rpx;">
|
||||||
|
<u-button color="#46BF6F" text="重新输入" @tap="showTips=false"></u-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<block v-else-if="tispTile=='验证码错误'">
|
||||||
|
<view class="">
|
||||||
|
验证码错误,请重新收入
|
||||||
|
</view>
|
||||||
|
<view class="" style="display: flex;">
|
||||||
|
<u-button color="#46BF6F" text="确定" @tap="showTips=false"></u-button>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<block v-else-if="tispTile=='密码不一致'">
|
||||||
|
<view class="">
|
||||||
|
两次输入的密码不一致,请重新输入
|
||||||
|
</view>
|
||||||
|
<view class="" style="display: flex;">
|
||||||
|
<u-button color="#46BF6F" text="确定" @tap="showTips=false"></u-button>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<view class="">
|
||||||
|
{{tispTile}}
|
||||||
|
</view>
|
||||||
|
<view class="" style="display: flex;width: 236rpx;">
|
||||||
|
<u-button color="#46BF6F" text="确定" @tap="showTips=false"></u-button>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</u-overlay>
|
||||||
|
<!-- tips结束 -->
|
||||||
|
|
||||||
</div>
|
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -246,7 +312,9 @@
|
|||||||
getCaptcha,
|
getCaptcha,
|
||||||
getAgreementApi,
|
getAgreementApi,
|
||||||
appleLogin,
|
appleLogin,
|
||||||
loginMpPhone
|
loginMpPhone,
|
||||||
|
registerForget,
|
||||||
|
phonelogin
|
||||||
} from "@/api/user";
|
} from "@/api/user";
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
import {
|
import {
|
||||||
@ -288,6 +356,7 @@
|
|||||||
} from "../../../libs/uniApi";
|
} from "../../../libs/uniApi";
|
||||||
const BACK_URL = "login_back_url";
|
const BACK_URL = "login_back_url";
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
|
import oneClickStyle from "./oneClickStyle.js"
|
||||||
var jpushModule = uni.requireNativePlugin("JG-JPush");
|
var jpushModule = uni.requireNativePlugin("JG-JPush");
|
||||||
// #endif
|
// #endif
|
||||||
export default {
|
export default {
|
||||||
@ -299,10 +368,17 @@
|
|||||||
},
|
},
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
|
type1: true,
|
||||||
|
type2: true,
|
||||||
|
type3: true,
|
||||||
|
tipsErr: "",
|
||||||
|
tispTile: '密码错误',
|
||||||
|
showTips: false,
|
||||||
navList: ["快速登录", "账号登录"],
|
navList: ["快速登录", "账号登录"],
|
||||||
current: 0,
|
current: 0,
|
||||||
account: "",
|
account: "",
|
||||||
password: "",
|
password: "",
|
||||||
|
confirm_pwd: "",
|
||||||
captcha: "",
|
captcha: "",
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
formItem: 0,
|
formItem: 0,
|
||||||
@ -337,6 +413,8 @@
|
|||||||
formItem: function(nval, oVal) {
|
formItem: function(nval, oVal) {
|
||||||
if (nval == 1) {
|
if (nval == 1) {
|
||||||
this.type = 'login'
|
this.type = 'login'
|
||||||
|
} else if (nval == 2) {
|
||||||
|
this.type = 'change_pwd'
|
||||||
} else {
|
} else {
|
||||||
this.type = 'register'
|
this.type = 'register'
|
||||||
}
|
}
|
||||||
@ -371,9 +449,18 @@
|
|||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showTipsFn(text, err) {
|
||||||
|
this.showTips = true
|
||||||
|
this.tispTile = text
|
||||||
|
this.tipsErr = err || ''
|
||||||
|
},
|
||||||
|
navgo(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url
|
||||||
|
})
|
||||||
|
},
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
getPhoneNumber(e) {
|
getPhoneNumber(e) {
|
||||||
|
|
||||||
let that = this;
|
let that = this;
|
||||||
loginMpPhone({
|
loginMpPhone({
|
||||||
iv: e.detail.iv,
|
iv: e.detail.iv,
|
||||||
@ -719,6 +806,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 快速登录
|
||||||
async loginMobile() {
|
async loginMobile() {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (!that.account) return that.$util.Tips({
|
if (!that.account) return that.$util.Tips({
|
||||||
@ -792,9 +880,7 @@
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(res => {
|
.catch(res => {
|
||||||
that.$util.Tips({
|
that.showTipsFn(res)
|
||||||
title: res
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async register() {
|
async register() {
|
||||||
@ -862,6 +948,90 @@
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(res => {
|
.catch(res => {
|
||||||
|
console.log(res, 'res')
|
||||||
|
that.showTipsFn('密码错误', res)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async weixinMerge() {
|
||||||
|
let that = this;
|
||||||
|
if (!that.account) return that.$util.Tips({
|
||||||
|
title: '请输入手机号码'
|
||||||
|
});
|
||||||
|
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||||
|
title: '请输入正确的手机号码'
|
||||||
|
});
|
||||||
|
if (!that.captcha) return that.$util.Tips({
|
||||||
|
title: '请输入验证码'
|
||||||
|
});
|
||||||
|
if (!/^[\w\d]+$/i.test(that.captcha)) return that.$util.Tips({
|
||||||
|
title: '请输入正确的验证码'
|
||||||
|
});
|
||||||
|
if (!that.password) return that.$util.Tips({
|
||||||
|
title: '请输入密码'
|
||||||
|
});
|
||||||
|
if (!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/i.test(that.password)) return that.$util.Tips({
|
||||||
|
title: '请输入6-16位字母加数字组合'
|
||||||
|
});
|
||||||
|
if (!that.isAgree) return that.$util.Tips({
|
||||||
|
title: '请勾选用户协议与隐私政策'
|
||||||
|
});
|
||||||
|
console.log('绑定前', {
|
||||||
|
auth_token: this.auth_token || uni.getStorageSync('auth_token'),
|
||||||
|
phone: that.account,
|
||||||
|
sms_code: that.captcha,
|
||||||
|
pwd: that.password,
|
||||||
|
spread: that.$Cache.get("spread"),
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
user_type: 'app',
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
user_type: 'h5',
|
||||||
|
// #endif
|
||||||
|
});
|
||||||
|
userMerge({
|
||||||
|
auth_token: this.auth_token || uni.getStorageSync('auth_token'),
|
||||||
|
phone: that.account,
|
||||||
|
sms_code: that.captcha,
|
||||||
|
pwd: that.password,
|
||||||
|
spread: that.$Cache.get("spread"),
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
user_type: 'app',
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
user_type: 'h5',
|
||||||
|
// #endif
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
console.log(res);
|
||||||
|
that.$store.commit("LOGIN", {
|
||||||
|
'token': res.data.token,
|
||||||
|
'time': res.data.exp
|
||||||
|
});
|
||||||
|
that.$store.commit("SETUID", res.data.user.uid);
|
||||||
|
that.$store.commit('UPDATE_USERINFO', res.data.user);
|
||||||
|
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
|
||||||
|
"/pages/index/index";
|
||||||
|
that.$Cache.clear(BACK_URL);
|
||||||
|
that.$Cache.clear('login_back_url_weixin');
|
||||||
|
let method
|
||||||
|
let indexPat = ['/pages/index/index', '/pages/order_addcart/order_addcart',
|
||||||
|
'/pages/goods_cate/goods_cate',
|
||||||
|
'/pages/user/index'
|
||||||
|
]
|
||||||
|
if (indexPat.includes(this.getPath(backUrl))) {
|
||||||
|
method = 'switchTab'
|
||||||
|
} else {
|
||||||
|
method = 'navigateTo'
|
||||||
|
}
|
||||||
|
uni[method]({
|
||||||
|
url: backUrl,
|
||||||
|
success: () => {
|
||||||
|
this.auth_token = ''
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(res => {
|
||||||
|
console.log('error', err);
|
||||||
that.$util.Tips({
|
that.$util.Tips({
|
||||||
title: res
|
title: res
|
||||||
});
|
});
|
||||||
@ -963,7 +1133,7 @@
|
|||||||
// if (that.formItem == 2) that.type = "register";
|
// if (that.formItem == 2) that.type = "register";
|
||||||
await registerVerify({
|
await registerVerify({
|
||||||
phone: that.account,
|
phone: that.account,
|
||||||
type: 'login',
|
type: that.type,
|
||||||
key: that.keyCode,
|
key: that.keyCode,
|
||||||
// code: that.codeVal,
|
// code: that.codeVal,
|
||||||
toke: data.token,
|
toke: data.token,
|
||||||
@ -982,6 +1152,38 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
async registerReset() {
|
||||||
|
var that = this;
|
||||||
|
if (!that.account) return that.$util.Tips({
|
||||||
|
title: '请填写手机号码'
|
||||||
|
});
|
||||||
|
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.account)) return that.$util.Tips({
|
||||||
|
title: '请输入正确的手机号码'
|
||||||
|
});
|
||||||
|
if (that.password == '123456') return that.$util.Tips({
|
||||||
|
title: '您输入的密码过于简单'
|
||||||
|
});
|
||||||
|
if (that.password != that.confirm_pwd) return that.$util.Tips({
|
||||||
|
title: '两次密码不一致'
|
||||||
|
});
|
||||||
|
if (!that.captcha) return that.$util.Tips({
|
||||||
|
title: '请填写验证码'
|
||||||
|
});
|
||||||
|
registerForget({
|
||||||
|
phone: that.account,
|
||||||
|
sms_code: that.captcha,
|
||||||
|
pwd: that.password,
|
||||||
|
confirm_pwd: that.confirm_pwd
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
that.submitSuccess(res.data)
|
||||||
|
})
|
||||||
|
.catch(res => {
|
||||||
|
that.$util.Tips({
|
||||||
|
title: res
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
getcaptcha() {
|
getcaptcha() {
|
||||||
let that = this
|
let that = this
|
||||||
getCaptcha().then(data => {
|
getCaptcha().then(data => {
|
||||||
@ -1000,6 +1202,8 @@
|
|||||||
}
|
}
|
||||||
return url
|
return url
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 账号登录
|
||||||
async submit() {
|
async submit() {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (!that.account) return that.$util.Tips({
|
if (!that.account) return that.$util.Tips({
|
||||||
@ -1025,9 +1229,19 @@
|
|||||||
}).then(({
|
}).then(({
|
||||||
data
|
data
|
||||||
}) => {
|
}) => {
|
||||||
console.log(data)
|
this.submitSuccess(data)
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
that.showTipsFn("密码错误", e)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 账号密码验证通过后的逻辑
|
||||||
|
submitSuccess(data) {
|
||||||
|
console.log(data, 'hanshu')
|
||||||
|
let that = this
|
||||||
this.checkOpenId(data.user)
|
this.checkOpenId(data.user)
|
||||||
const backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
|
let backUrl = that.$Cache.get('login_back_url_weixin') || that.$Cache.get(BACK_URL) ||
|
||||||
"/pages/index/index";
|
"/pages/index/index";
|
||||||
that.$store.commit("LOGIN", {
|
that.$store.commit("LOGIN", {
|
||||||
'token': data.token,
|
'token': data.token,
|
||||||
@ -1050,6 +1264,9 @@
|
|||||||
'/pages/goods_cate/goods_cate',
|
'/pages/goods_cate/goods_cate',
|
||||||
'/pages/user/index'
|
'/pages/user/index'
|
||||||
]
|
]
|
||||||
|
// #ifdef H5
|
||||||
|
backUrl = backUrl.replace('/h5', '')
|
||||||
|
// #endif
|
||||||
if (indexPat.includes(this.getPath(backUrl))) {
|
if (indexPat.includes(this.getPath(backUrl))) {
|
||||||
method = 'switchTab'
|
method = 'switchTab'
|
||||||
} else {
|
} else {
|
||||||
@ -1065,14 +1282,8 @@
|
|||||||
uni[method]({
|
uni[method]({
|
||||||
url: backUrl
|
url: backUrl
|
||||||
});
|
});
|
||||||
})
|
|
||||||
.catch(e => {
|
|
||||||
console.log(e)
|
|
||||||
that.$util.Tips({
|
|
||||||
title: e
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getVersion() {
|
getVersion() {
|
||||||
getVersion().then(data => {
|
getVersion().then(data => {
|
||||||
this.copyright = data.data;
|
this.copyright = data.data;
|
||||||
@ -1144,13 +1355,66 @@
|
|||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
},
|
||||||
|
// app手机号一键登录
|
||||||
|
appOneClcik() {
|
||||||
|
let that = this
|
||||||
|
uni.preLogin({
|
||||||
|
provider: 'univerify',
|
||||||
|
success() {
|
||||||
|
console.log("当前环境支持一键登录")
|
||||||
|
uni.login({
|
||||||
|
provider: 'univerify',
|
||||||
|
univerifyStyle: oneClickStyle,
|
||||||
|
success(res) {
|
||||||
|
console.log(res, 'res')
|
||||||
|
phonelogin({
|
||||||
|
access_token: res.authResult.access_token,
|
||||||
|
openid: res.authResult.openid,
|
||||||
|
auth_token: that.auth_token,
|
||||||
|
user_type: 'app'
|
||||||
|
}).then(res => {
|
||||||
|
uni.closeAuthView()
|
||||||
|
that.submitSuccess(res.data)
|
||||||
|
}).catch(err => {
|
||||||
|
uni.closeAuthView()
|
||||||
|
that.$util.Tips({
|
||||||
|
title: '登录失败,请稍后再试'
|
||||||
|
});
|
||||||
|
})
|
||||||
|
// uniCloud.callFunction({
|
||||||
|
// name: 'oneClickLoginFn',
|
||||||
|
// data: {
|
||||||
|
// 'access_token': res.authResult
|
||||||
|
// .access_token,
|
||||||
|
// 'openid': res.authResult.openid
|
||||||
|
// }
|
||||||
|
// }).then(res => {
|
||||||
|
// console.log(res, '登录成功后的res')
|
||||||
|
// }).catch(err => {
|
||||||
|
// console.log(err, 'ererre')
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
fail(res) { // 登录失败
|
||||||
|
console.log(res.errCode)
|
||||||
|
console.log(res.errMsg)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail(res) {
|
||||||
|
that.$util.Tips({
|
||||||
|
title: '当前环境不支持一键登录'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
page {
|
page {
|
||||||
background-color: #fff !important;
|
background-color: white !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/uni-checkbox .uni-checkbox-input {
|
/deep/uni-checkbox .uni-checkbox-input {
|
||||||
@ -1531,4 +1795,62 @@
|
|||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footer-btns {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 100rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%);
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 750rpx !important;
|
||||||
|
padding: 0 112rpx;
|
||||||
|
|
||||||
|
.login-type-btn {
|
||||||
|
padding: 12rpx 30rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
background-color: #F6F6F6
|
||||||
|
}
|
||||||
|
|
||||||
|
.actLoginType {
|
||||||
|
color: #20B128;
|
||||||
|
background-color: #E8F7E9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer-btn {
|
||||||
|
display: flex;
|
||||||
|
background-color: white;
|
||||||
|
width: 750rpx !important;
|
||||||
|
padding: 0 112rpx 50rpx 112rpx;
|
||||||
|
margin-top: 30rpx 0 30rpx 0;
|
||||||
|
|
||||||
|
.login-type-btn {
|
||||||
|
padding: 12rpx 30rpx;
|
||||||
|
border-radius: 32rpx;
|
||||||
|
background-color: #F6F6F6
|
||||||
|
}
|
||||||
|
|
||||||
|
.actLoginType {
|
||||||
|
color: #20B128;
|
||||||
|
background-color: #E8F7E9;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
width: 590rpx;
|
||||||
|
height: 354rpx;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 50rpx 40rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
69
pages/users/login/oneClickStyle.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
let customStyle = {
|
||||||
|
"fullScreen": true, // 是否全屏显示,默认值: false
|
||||||
|
"backgroundColor": "#ffffff", // 授权页面背景颜色,默认值:#ffffff
|
||||||
|
"backgroundImage": "", // 全屏显示的背景图片,默认值:"" (仅支持本地图片,只有全屏显示时支持)
|
||||||
|
"icon": {
|
||||||
|
"path": "static/xxx.png", // 自定义显示在授权框中的logo,仅支持本地图片 默认显示App logo
|
||||||
|
"width": "60px", //图标宽度 默认值:60px
|
||||||
|
"height": "60px" //图标高度 默认值:60px
|
||||||
|
},
|
||||||
|
"closeIcon": {
|
||||||
|
"path": "static/xxx.png", // 自定义显示在授权框中的logo,仅支持本地图片 默认显示App logo
|
||||||
|
"width": "60px", //图标宽度 默认值:60px (HBuilderX 4.0支持)
|
||||||
|
"height": "60px" //图标高度 默认值:60px (HBuilderX 4.0支持)
|
||||||
|
},
|
||||||
|
"phoneNum": {
|
||||||
|
"color": "#202020" // 手机号文字颜色 默认值:#202020
|
||||||
|
},
|
||||||
|
"slogan": {
|
||||||
|
"color": "#BBBBBB" // slogan 字体颜色 默认值:#BBBBBB
|
||||||
|
},
|
||||||
|
"authButton": {
|
||||||
|
"normalColor": "#3CB625", // 授权按钮正常状态背景颜色 默认值:#3479f5
|
||||||
|
"highlightColor": "#2861c5", // 授权按钮按下状态背景颜色 默认值:#2861c5(仅ios支持)
|
||||||
|
"disabledColor": "#73aaf5", // 授权按钮不可点击时背景颜色 默认值:#73aaf5(仅ios支持)
|
||||||
|
"textColor": "#ffffff", // 授权按钮文字颜色 默认值:#ffffff
|
||||||
|
"title": "本机号码一键登录", // 授权按钮文案 默认值:“本机号码一键登录”
|
||||||
|
"borderRadius": "24px" // 授权按钮圆角 默认值:"24px" (按钮高度的一半)
|
||||||
|
},
|
||||||
|
"otherLoginButton": {
|
||||||
|
"visible": true, // 是否显示其他登录按钮,默认值:true
|
||||||
|
"normalColor": "", // 其他登录按钮正常状态背景颜色 默认值:透明
|
||||||
|
"highlightColor": "", // 其他登录按钮按下状态背景颜色 默认值:透明
|
||||||
|
"textColor": "#656565", // 其他登录按钮文字颜色 默认值:#656565
|
||||||
|
"title": "其他登录方式", // 其他登录方式按钮文字 默认值:“其他登录方式”
|
||||||
|
"borderColor": "", //边框颜色 默认值:透明(仅iOS支持)
|
||||||
|
"borderRadius": "0px" // 其他登录按钮圆角 默认值:"24px" (按钮高度的一半)
|
||||||
|
},
|
||||||
|
"privacyTerms": {
|
||||||
|
"defaultCheckBoxState": true, // 条款勾选框初始状态 默认值: true
|
||||||
|
"isCenterHint": false, //未勾选服务条款时点击登录按钮的提示是否居中显示 默认值: false (3.7.13+ 版本支持)
|
||||||
|
"uncheckedImage": "", // 可选 条款勾选框未选中状态图片(仅支持本地图片 建议尺寸 24x24px)(3.2.0+ 版本支持)
|
||||||
|
"checkedImage": "", // 可选 条款勾选框选中状态图片(仅支持本地图片 建议尺寸24x24px)(3.2.0+ 版本支持)
|
||||||
|
"checkBoxSize": 12, // 可选 条款勾选框大小
|
||||||
|
"textColor": "#BBBBBB", // 文字颜色 默认值:#BBBBBB
|
||||||
|
"termsColor": "#5496E3", // 协议文字颜色 默认值: #5496E3
|
||||||
|
"prefix": "我已阅读并同意", // 条款前的文案 默认值:“我已阅读并同意”
|
||||||
|
"suffix": "并使用本机号码登录", // 条款后的文案 默认值:“并使用本机号码登录”
|
||||||
|
"privacyItems": [ // 自定义协议条款,最大支持2个,需要同时设置url和title. 否则不生效
|
||||||
|
{
|
||||||
|
"url": "https://", // 点击跳转的协议详情页面
|
||||||
|
"title": "用户服务协议" // 协议名称
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"buttons": { // 自定义页面下方按钮仅全屏模式生效(3.1.14+ 版本支持)
|
||||||
|
"iconWidth": "45px", // 图标宽度(高度等比例缩放) 默认值:45px
|
||||||
|
"list": [{
|
||||||
|
"provider": "apple",
|
||||||
|
"iconPath": "/static/apple.png" // 图标路径仅支持本地图片
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"provider": "weixin",
|
||||||
|
"iconPath": "/static/wechat.png" // 图标路径仅支持本地图片
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default customStyle
|
@ -603,6 +603,9 @@
|
|||||||
} else {
|
} else {
|
||||||
toLogin()
|
toLogin()
|
||||||
}
|
}
|
||||||
|
if (options.sale_type) {
|
||||||
|
this.sale_type = options.sale_type
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onReady: function() {
|
onReady: function() {
|
||||||
@ -888,7 +891,8 @@
|
|||||||
|
|
||||||
this.loadend = false;
|
this.loadend = false;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.$set(this, 'orderList', []);
|
this.orderList = [];
|
||||||
|
this.sale_type = type;
|
||||||
|
|
||||||
if (this.orderStatus == 4) {
|
if (this.orderStatus == 4) {
|
||||||
this.refundParam.identity = type;
|
this.refundParam.identity = type;
|
||||||
@ -901,7 +905,6 @@
|
|||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
this.getpreSellOrderList();
|
this.getpreSellOrderList();
|
||||||
}
|
}
|
||||||
this.sale_type = type;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取退款列表
|
// 获取退款列表
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
<block v-if="type == 2">
|
<block v-if="type == 2">
|
||||||
<view class="txt">请等待商家收货并退款</view>
|
<view class="txt">请等待商家收货并退款</view>
|
||||||
<view class="time">还剩:
|
<view class="time">还剩:
|
||||||
<countDown :is-day="true" :tip-text="' '" :day-text="'天'" :hour-text="':'" :minute-text="':'" :second-text="' '"
|
<countDown :is-day="true" :tip-text="' '" :day-text="'天'" :hour-text="':'" :minute-text="':'"
|
||||||
:datatime="datatime"></countDown>
|
:second-text="' '" :datatime="datatime"></countDown>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<block v-if="type == 3">
|
<block v-if="type == 3">
|
||||||
@ -59,12 +59,17 @@
|
|||||||
<view class="title">退款信息</view>
|
<view class="title">退款信息</view>
|
||||||
<view class="product-box">
|
<view class="product-box">
|
||||||
<view class="product-item" v-for="(item,index) in detail.refundProduct" :key="index">
|
<view class="product-item" v-for="(item,index) in detail.refundProduct" :key="index">
|
||||||
<image class="img-box" :src="item.product.cart_info.productAttr.image" mode="" v-if="item.product.cart_info.productAttr.image"></image>
|
<image class="img-box" :src="item.product.cart_info.productAttr.image" mode=""
|
||||||
|
v-if="item.product.cart_info.productAttr.image"></image>
|
||||||
<image class="img-box" :src="item.product.cart_info.product.image" mode="" v-else></image>
|
<image class="img-box" :src="item.product.cart_info.product.image" mode="" v-else></image>
|
||||||
<view class="msg">
|
<view class="msg">
|
||||||
<view class="name line1"><text v-if="item.product.cart_info.product_type === 2" class="event_name event_bg">预售</text>{{item.product.cart_info.product.store_name}}</view>
|
<view class="name line1"><text v-if="item.product.cart_info.product_type === 2"
|
||||||
|
class="event_name event_bg">预售</text>{{item.product.cart_info.product.store_name}}
|
||||||
|
</view>
|
||||||
<view class="des">{{item.product.cart_info.productAttr.sku}}</view>
|
<view class="des">{{item.product.cart_info.productAttr.sku}}</view>
|
||||||
<view class="price">¥{{item.product.product_type == 3 ? item.product.cart_info.productAssistAttr.assist_price : item.product.product_type == 4 ? item.product.cart_info.activeSku.active_price : item.product.cart_info.productAttr.price}}</view>
|
<view class="price">
|
||||||
|
¥{{item.product.product_type == 3 ? item.product.cart_info.productAssistAttr.assist_price : item.product.product_type == 4 ? item.product.cart_info.activeSku.active_price : item.product.cart_info.productAttr.price}}
|
||||||
|
</view>
|
||||||
<view class="num">x {{item.refund_num}}</view>
|
<view class="num">x {{item.refund_num}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -95,6 +100,13 @@
|
|||||||
<text>{{detail.refund_num}}</text>
|
<text>{{detail.refund_num}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="item">
|
||||||
|
<view class="label">退款原因:</view>
|
||||||
|
<view class="txt flex">
|
||||||
|
<text>{{ getRightText(detail.refund_message) }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="label">申请时间:</view>
|
<view class="label">申请时间:</view>
|
||||||
<view class="txt flex">
|
<view class="txt flex">
|
||||||
@ -148,10 +160,15 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import { refundDetail, refundCancelApi } from '@/api/order.js'
|
import {
|
||||||
|
refundDetail,
|
||||||
|
refundCancelApi
|
||||||
|
} from '@/api/order.js'
|
||||||
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
|
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
|
||||||
import countDown from '@/components/countDown'
|
import countDown from '@/components/countDown'
|
||||||
import { mapGetters } from "vuex";
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
countDown,
|
countDown,
|
||||||
@ -169,7 +186,7 @@
|
|||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title:'退款详情'
|
title: '退款详情'
|
||||||
})
|
})
|
||||||
this.refund_order_id = options.id
|
this.refund_order_id = options.id
|
||||||
this.getDetail()
|
this.getDetail()
|
||||||
@ -187,6 +204,14 @@
|
|||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getRightText(str) {
|
||||||
|
const index = str.indexOf("@");
|
||||||
|
if (index !== -1) {
|
||||||
|
return str.substring(0, index);
|
||||||
|
} else {
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
},
|
||||||
//联系客服拨打电话
|
//联系客服拨打电话
|
||||||
call: function(service) {
|
call: function(service) {
|
||||||
let that = this;
|
let that = this;
|
||||||
@ -293,16 +318,20 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: #666666;
|
background-color: #666666;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
|
||||||
.txt {
|
.txt {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
opacity: .8;
|
opacity: .8;
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 600rpx;
|
width: 600rpx;
|
||||||
|
|
||||||
/deep/ .red {
|
/deep/ .red {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
@ -313,21 +342,25 @@
|
|||||||
.info-box {
|
.info-box {
|
||||||
margin-top: 12rpx;
|
margin-top: 12rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
padding: 0 32rpx;
|
padding: 0 32rpx;
|
||||||
line-height: 86rpx;
|
line-height: 86rpx;
|
||||||
border-bottom: 1px solid #F0F0F0;
|
border-bottom: 1px solid #F0F0F0;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-box {
|
.product-box {
|
||||||
.product-item {
|
.product-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 25rpx 30rpx;
|
padding: 25rpx 30rpx;
|
||||||
|
|
||||||
.img-box {
|
.img-box {
|
||||||
width: 130rpx;
|
width: 130rpx;
|
||||||
height: 130rpx;
|
height: 130rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.msg {
|
.msg {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -335,18 +368,22 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: 440rpx;
|
width: 440rpx;
|
||||||
margin-left: 26rpx;
|
margin-left: 26rpx;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
.des {
|
.des {
|
||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
color: #868686;
|
color: #868686;
|
||||||
}
|
}
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: var(--view-priceColor);
|
color: var(--view-priceColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: -80rpx;
|
right: -80rpx;
|
||||||
@ -356,6 +393,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.event_name {
|
.event_name {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 9rpx;
|
margin-right: 9rpx;
|
||||||
@ -371,19 +409,23 @@
|
|||||||
.event_bg {
|
.event_bg {
|
||||||
background: #FF7F00;
|
background: #FF7F00;
|
||||||
}
|
}
|
||||||
|
|
||||||
.store-info {
|
.store-info {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
|
|
||||||
.des {
|
.des {
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #868686;
|
color: #868686;
|
||||||
}
|
}
|
||||||
|
|
||||||
.red-txt {
|
.red-txt {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
color: $theme-color;
|
color: $theme-color;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
margin-right: 5rpx;
|
margin-right: 5rpx;
|
||||||
@ -392,20 +434,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
margin-top: 12rpx;
|
margin-top: 12rpx;
|
||||||
padding: 30rpx 30rpx 0;
|
padding: 30rpx 30rpx 0;
|
||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
|
|
||||||
.txt {
|
.txt {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 450rpx;
|
width: 450rpx;
|
||||||
color: #868686;
|
color: #868686;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|
||||||
.copy {
|
.copy {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -419,22 +465,27 @@
|
|||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upload-img {
|
.upload-img {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
|
||||||
.img-item {
|
.img-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 156rpx;
|
width: 156rpx;
|
||||||
height: 156rpx;
|
height: 156rpx;
|
||||||
margin-right: 23rpx;
|
margin-right: 23rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
|
|
||||||
&:nth-child(4n) {
|
&:nth-child(4n) {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 156rpx;
|
width: 156rpx;
|
||||||
height: 156rpx;
|
height: 156rpx;
|
||||||
@ -443,15 +494,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-wrapper {
|
.btn-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 100rpx;
|
height: 100rpx;
|
||||||
|
|
||||||
button {
|
button {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: 176rpx;
|
width: 176rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
@ -463,11 +517,13 @@
|
|||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gray {
|
.gray {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
color: #AAAAAA;
|
color: #AAAAAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:after {
|
&:after {
|
||||||
content: ' ';
|
content: ' ';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -480,12 +536,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
margin-top: 12rpx;
|
margin-top: 12rpx;
|
||||||
padding: 25rpx 30rpx;
|
padding: 25rpx 30rpx;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
|
|
||||||
.des {
|
.des {
|
||||||
margin-top: 5rpx;
|
margin-top: 5rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
@ -493,6 +551,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/.styleAll {
|
/deep/.styleAll {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
@ -5,35 +5,42 @@
|
|||||||
<image :src="login_logo" v-if="login_logo" />
|
<image :src="login_logo" v-if="login_logo" />
|
||||||
</view>
|
</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="whiteBg" style="margin: 0;width: 100%;padding: 50rpx 60rpx;" :style="{ 'background-image': `url(${domain}/static/images/logo_bgl.png)`}">
|
<view class="whiteBg" style="margin: 0;width: 100%;padding: 50rpx 60rpx;"
|
||||||
|
:style="{ 'background-image': `url(${domain}/static/images/logo_bgl.png)`}">
|
||||||
<view class="login_title">
|
<view class="login_title">
|
||||||
<view class="title_h">找回密码</view>
|
<view class="title_h">找回密码</view>
|
||||||
</view>
|
</view>
|
||||||
<form class="list">
|
<form class="list">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<input type="number" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account" autocomplete="off" />
|
<input type="number" placeholder="输入手机号码" placeholder-class="placeholder" v-model="account"
|
||||||
|
autocomplete="off" />
|
||||||
<!-- <input type="text" style="height: 0;opacity: 0"> -->
|
<!-- <input type="text" style="height: 0;opacity: 0"> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<input type="password" placeholder="填写您的新密码" placeholder-class="placeholder" v-model="password" autocomplete="off" />
|
<input type="password" placeholder="填写您的新密码" placeholder-class="placeholder" v-model="password"
|
||||||
|
autocomplete="off" />
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<input type="password" placeholder="再次输入新密码" placeholder-class="placeholder" v-model="confirm_pwd" autocomplete="off" />
|
<input type="password" placeholder="再次输入新密码" placeholder-class="placeholder" v-model="confirm_pwd"
|
||||||
|
autocomplete="off" />
|
||||||
</view>
|
</view>
|
||||||
<view class="item" style="display: flex;justify-content: space-between;">
|
<view class="item" style="display: flex;justify-content: space-between;">
|
||||||
<input type="number" placeholder="填写验证码" maxlength="4" placeholder-class="placeholder" class="codeIput" v-model="captcha" autocomplete="off" />
|
<input type="number" placeholder="填写验证码" maxlength="4" placeholder-class="placeholder"
|
||||||
<button class="code" style="color: #fff;" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="handleVerify">
|
class="codeIput" v-model="captcha" autocomplete="off" />
|
||||||
|
<button class="code" style="color: #fff;" :disabled="disabled"
|
||||||
|
:class="disabled === true ? 'on' : ''" @click="handleVerify">
|
||||||
{{ text }}
|
{{ text }}
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</form>
|
</form>
|
||||||
<view class="logon" @click="registerReset">确认</view>
|
<view class="logon" @click="registerReset">确认</view>
|
||||||
<view class="tip">
|
<!-- <view class="tip">
|
||||||
<text @click="back">立即登录</text>
|
<text @click="back">立即登录</text>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom"></view>
|
<view class="bottom"></view>
|
||||||
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
|
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
|
||||||
|
ref="verify"></Verify>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -48,7 +55,9 @@
|
|||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
const app = getApp();
|
const app = getApp();
|
||||||
import { mapGetters} from "vuex";
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||||
import {
|
import {
|
||||||
registerVerify,
|
registerVerify,
|
||||||
@ -56,14 +65,20 @@
|
|||||||
getCodeApi,
|
getCodeApi,
|
||||||
getCaptcha
|
getCaptcha
|
||||||
} from "@/api/user";
|
} from "@/api/user";
|
||||||
import { validatorDefaultCatch } from "@/utils/dialog";
|
import {
|
||||||
|
validatorDefaultCatch
|
||||||
|
} from "@/utils/dialog";
|
||||||
import attrs, {
|
import attrs, {
|
||||||
required,
|
required,
|
||||||
alpha_num,
|
alpha_num,
|
||||||
chs_phone
|
chs_phone
|
||||||
} from "@/utils/validate";
|
} from "@/utils/validate";
|
||||||
import { configMap } from '@/utils';
|
import {
|
||||||
import { HTTP_REQUEST_URL } from '@/config/app';
|
configMap
|
||||||
|
} from '@/utils';
|
||||||
|
import {
|
||||||
|
HTTP_REQUEST_URL
|
||||||
|
} from '@/config/app';
|
||||||
import Verify from '@/components/verify/verify.vue';
|
import Verify from '@/components/verify/verify.vue';
|
||||||
export default {
|
export default {
|
||||||
name: "RetrievePassword",
|
name: "RetrievePassword",
|
||||||
@ -85,10 +100,8 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: configMap(['login_logo'], mapGetters(['viewColor'])),
|
computed: configMap(['login_logo'], mapGetters(['viewColor'])),
|
||||||
onReady() {
|
onReady() {},
|
||||||
},
|
mounted: function() {},
|
||||||
mounted: function() {
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
back() {
|
back() {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
@ -184,9 +197,11 @@
|
|||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register .list .item .code {
|
.register .list .item .code {
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
.whiteBg .logon {
|
.whiteBg .logon {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -199,6 +214,7 @@
|
|||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.whiteBg {
|
.whiteBg {
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 100% auto;
|
background-size: 100% auto;
|
||||||
|
@ -42,7 +42,9 @@
|
|||||||
userOut,
|
userOut,
|
||||||
getLogout
|
getLogout
|
||||||
} from '@/api/user.js'
|
} from '@/api/user.js'
|
||||||
import { mapGetters } from "vuex";
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
name: 'user_about',
|
name: 'user_about',
|
||||||
data() {
|
data() {
|
||||||
@ -86,9 +88,13 @@
|
|||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: res.message,
|
content: res.message,
|
||||||
success: ({confirm}) => {
|
success: ({
|
||||||
|
confirm
|
||||||
|
}) => {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
userOut({key: res.data.result.key}).then(res => {
|
userOut({
|
||||||
|
key: res.data.result.key
|
||||||
|
}).then(res => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
if (res.data.status === 200) {
|
if (res.data.status === 200) {
|
||||||
call()
|
call()
|
||||||
@ -181,19 +187,23 @@
|
|||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancelTxt {
|
.cancelTxt {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancel {
|
.cancel {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 60rpx;
|
bottom: 60rpx;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.checkbox {
|
.checkbox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -201,21 +211,26 @@
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
margin-left: 5rpx;
|
margin-left: 5rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.font {
|
.font {
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
margin-right: 15rpx;
|
margin-right: 15rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-xuanzhong1 {
|
.icon-xuanzhong1 {
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
@ -231,6 +246,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.outMoal {
|
.outMoal {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@ -242,6 +258,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
width: 590rpx;
|
width: 590rpx;
|
||||||
@ -251,15 +268,18 @@
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 50rpx;
|
padding: 50rpx;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
|
|
||||||
.moalBtn {
|
.moalBtn {
|
||||||
margin-top: 43rpx;
|
margin-top: 43rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.ok {
|
.ok {
|
||||||
width: 234rpx;
|
width: 234rpx;
|
||||||
height: 66rpx;
|
height: 66rpx;
|
||||||
@ -269,6 +289,7 @@
|
|||||||
line-height: 66rpx;
|
line-height: 66rpx;
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
.no {
|
.no {
|
||||||
width: 234rpx;
|
width: 234rpx;
|
||||||
height: 66rpx;
|
height: 66rpx;
|
||||||
|
@ -677,10 +677,11 @@
|
|||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
border-radius: 45rpx;
|
border-radius: 45rpx;
|
||||||
margin: 80rpx auto 0 auto;
|
margin: 80rpx auto 40rpx auto;
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border: 1px solid var(--view-theme);
|
border: 1px solid var(--view-theme);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.avatar-box {
|
.avatar-box {
|
||||||
|
@ -195,8 +195,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<loadmore :type="isLoading" v-if="isLoading || hostProduct.length > 0"
|
<loadmore :type="isLoading" v-if="isLoading || hostProduct.length > 0" style="padding: 12rpx 0;">
|
||||||
style="background-color: #fff;padding: 12rpx 0;">
|
|
||||||
</loadmore>
|
</loadmore>
|
||||||
<view class='pictrue' v-if="!isLoading && hostProduct.length == 0">
|
<view class='pictrue' v-if="!isLoading && hostProduct.length == 0">
|
||||||
<image :src="`${domain}/static/images/noCart.png`"></image>
|
<image :src="`${domain}/static/images/noCart.png`"></image>
|
||||||
|
BIN
static/images/YDT.png
Normal file
After Width: | Height: | Size: 166 KiB |
BIN
static/images/diverPointer.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
static/images/eye.png
Normal file
After Width: | Height: | Size: 989 B |
BIN
static/images/greenLine.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
static/images/greenLineDown.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
static/images/offeye.png
Normal file
After Width: | Height: | Size: 984 B |
BIN
static/images/pointer.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
static/images/starpng.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
static/images/tabSc.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
static/images/ydwd.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
static/images/ydwd1.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
@ -19,7 +19,9 @@ import {
|
|||||||
import Cache from '../../utils/cache';
|
import Cache from '../../utils/cache';
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
import Updater from '@/uni_modules/guyue-updater/index';
|
import Updater from '@/uni_modules/guyue-updater/index';
|
||||||
import { Toast } from "../../libs/uniApi.js";
|
import {
|
||||||
|
Toast
|
||||||
|
} from "../../libs/uniApi.js";
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
||||||
@ -28,14 +30,16 @@ const state = {
|
|||||||
token: Cache.get(LOGIN_STATUS) || null,
|
token: Cache.get(LOGIN_STATUS) || null,
|
||||||
uuid: uni.getStorageSync('uuid') || "",
|
uuid: uni.getStorageSync('uuid') || "",
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
userInfo: (typeof Cache.get('USER_INFO') == 'string' ? JSON.parse(Cache.get('USER_INFO')) : Cache.get('USER_INFO'))||{},
|
userInfo: (typeof Cache.get('USER_INFO') == 'string' ? JSON.parse(Cache.get('USER_INFO')) : Cache.get(
|
||||||
|
'USER_INFO')) || {},
|
||||||
uid: Cache.get(UID) || null,
|
uid: Cache.get(UID) || null,
|
||||||
globalData: uni.getStorageSync('GLOBAL_DATA') || {},
|
globalData: uni.getStorageSync('GLOBAL_DATA') || {},
|
||||||
homeActive: false,
|
homeActive: false,
|
||||||
copyPwd: null,
|
copyPwd: null,
|
||||||
pageFooter: uni.getStorageSync('pageFoot') || {},
|
pageFooter: uni.getStorageSync('pageFoot') || {},
|
||||||
keyColor: Cache.get('KEY_COLOR') || '_default',
|
keyColor: Cache.get('KEY_COLOR') || '_default',
|
||||||
viewColor: Cache.get('VIEW_COLOR') || '--view-theme: #E93323;--view-assist:#FF7612;--view-priceColor:#E93323;--view-bgColor:rgba(255, 118, 18,.1);--view-minorColor:rgba(233, 51, 35,.1);--view-bntColor11:#FDA923;--view-bntColor12:#FD6523;--view-bntColor21:#F11B09;--view-bntColor22:#F67A38;',
|
viewColor: Cache.get('VIEW_COLOR') ||
|
||||||
|
'--view-theme: #E93323;--view-assist:#FF7612;--view-priceColor:#E93323;--view-bgColor:rgba(255, 118, 18,.1);--view-minorColor:rgba(233, 51, 35,.1);--view-bntColor11:#FDA923;--view-bntColor12:#FD6523;--view-bntColor21:#F11B09;--view-bntColor22:#F67A38;',
|
||||||
};
|
};
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@ -141,17 +145,17 @@ const actions = {
|
|||||||
} else {
|
} else {
|
||||||
apptype = 1
|
apptype = 1
|
||||||
}
|
}
|
||||||
console.log({
|
// console.log({
|
||||||
version: os.appWgtVersion,
|
// version: os.appWgtVersion,
|
||||||
type: apptype,
|
// type: apptype,
|
||||||
phone_brand:os.brand
|
// phone_brand:os.brand
|
||||||
});
|
// });
|
||||||
Appversion({
|
Appversion({
|
||||||
version: os.appWgtVersion,
|
version: os.appWgtVersion,
|
||||||
type: apptype,
|
type: apptype,
|
||||||
phone_brand: os.brand
|
phone_brand: os.brand
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res);
|
// console.log(res);
|
||||||
if (data) uni.hideLoading()
|
if (data) uni.hideLoading()
|
||||||
if (Object.keys(res.data.appInfo).length > 0) {
|
if (Object.keys(res.data.appInfo).length > 0) {
|
||||||
// if(res.data.appInfo.version) uni.showLoading({
|
// if(res.data.appInfo.version) uni.showLoading({
|
||||||
@ -176,8 +180,7 @@ const actions = {
|
|||||||
Toast(e)
|
Toast(e)
|
||||||
}
|
}
|
||||||
// uni.hideLoading();
|
// uni.hideLoading();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (data) Toast('已经是最新版本了')
|
if (data) Toast('已经是最新版本了')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
uni.scss
@ -15,7 +15,7 @@
|
|||||||
/* 颜色变量 */
|
/* 颜色变量 */
|
||||||
|
|
||||||
/* 行为相关颜色 */
|
/* 行为相关颜色 */
|
||||||
$uni-color-primary: #007aff;
|
$uni-color-primary: #20B128;
|
||||||
$uni-color-success: #4cd964;
|
$uni-color-success: #4cd964;
|
||||||
$uni-color-warning: #f0ad4e;
|
$uni-color-warning: #f0ad4e;
|
||||||
$uni-color-error: #dd524d;
|
$uni-color-error: #dd524d;
|
||||||
|
35
uniCloud-aliyun/cloudfunctions/oneClickLoginFn/index.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// 下面仅展示客户端使用post方式发送content-type为application/json请求的场景
|
||||||
|
exports.main = async (event) => {
|
||||||
|
let body = event.body
|
||||||
|
if (event.isBase64Encoded) {
|
||||||
|
body = Buffer.from(body, 'base64')
|
||||||
|
}
|
||||||
|
const {
|
||||||
|
access_token,
|
||||||
|
openid
|
||||||
|
} = JSON.parse(body)
|
||||||
|
if (!access_token || !openid) {
|
||||||
|
return { // 不建议把完整手机号返回给前端
|
||||||
|
success: false,
|
||||||
|
error: {
|
||||||
|
code: 'params is not fund',
|
||||||
|
message: '参数错误',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const res = await uniCloud.getPhoneNumber({
|
||||||
|
provider: 'univerify',
|
||||||
|
appid: '__UNI__3A527D1', // DCloud appid,不同于callFunction方式调用,使用云函数Url化需要传递DCloud appid参数!!!
|
||||||
|
access_token: access_token,
|
||||||
|
openid: openid
|
||||||
|
})
|
||||||
|
console.log(res); // res里包含手机号
|
||||||
|
return { // 不建议把完整手机号返回给前端
|
||||||
|
success: true,
|
||||||
|
info: {
|
||||||
|
code: 0,
|
||||||
|
message: '获取手机号成功',
|
||||||
|
data: res,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"name": "oneClickLoginFn",
|
||||||
|
"dependencies": {},
|
||||||
|
"extensions": {
|
||||||
|
"uni-cloud-jql": {},
|
||||||
|
"uni-cloud-verify": {}
|
||||||
|
}
|
||||||
|
}
|
12
uniCloud-aliyun/database/JQL查询.jql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// 本文件用于,使用JQL语法操作项目关联的uniCloud空间的数据库,方便开发调试和远程数据库管理
|
||||||
|
// 编写clientDB的js API(也支持常规js语法,比如var),可以对云数据库进行增删改查操作。不支持uniCloud-db组件写法
|
||||||
|
// 可以全部运行,也可以选中部分代码运行。点击工具栏上的运行按钮或者按下【F5】键运行代码
|
||||||
|
// 如果文档中存在多条JQL语句,只有最后一条语句生效
|
||||||
|
// 如果混写了普通js,最后一条语句需是数据库操作语句
|
||||||
|
// 此处代码运行不受DB Schema的权限控制,移植代码到实际业务中注意在schema中配好permission
|
||||||
|
// 不支持clientDB的action
|
||||||
|
// 数据库查询有最大返回条数限制,详见:https://uniapp.dcloud.net.cn/uniCloud/cf-database.html#limit
|
||||||
|
// 详细JQL语法,请参考:https://uniapp.dcloud.net.cn/uniCloud/jql.html
|
||||||
|
|
||||||
|
// 下面示例查询uni-id-users表的所有数据
|
||||||
|
db.collection('uni-id-users').get();
|
6
uni_modules/uni-config-center/changelog.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
## 0.0.3(2022-11-11)
|
||||||
|
- 修复 config 方法获取根节点为数组格式配置时错误的转化为了对象的Bug
|
||||||
|
## 0.0.2(2021-04-16)
|
||||||
|
- 修改插件package信息
|
||||||
|
## 0.0.1(2021-03-15)
|
||||||
|
- 初始化项目
|
81
uni_modules/uni-config-center/package.json
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-config-center",
|
||||||
|
"displayName": "uni-config-center",
|
||||||
|
"version": "0.0.3",
|
||||||
|
"description": "uniCloud 配置中心",
|
||||||
|
"keywords": [
|
||||||
|
"配置",
|
||||||
|
"配置中心"
|
||||||
|
],
|
||||||
|
"repository": "",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": "^3.1.0"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "",
|
||||||
|
"type": "unicloud-template-function"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"example": "../../../scripts/dist"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"App": {
|
||||||
|
"app-vue": "u",
|
||||||
|
"app-nvue": "u"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "u",
|
||||||
|
"Android Browser": "u",
|
||||||
|
"微信浏览器(Android)": "u",
|
||||||
|
"QQ浏览器(Android)": "u"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "u",
|
||||||
|
"IE": "u",
|
||||||
|
"Edge": "u",
|
||||||
|
"Firefox": "u",
|
||||||
|
"Safari": "u"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "u",
|
||||||
|
"阿里": "u",
|
||||||
|
"百度": "u",
|
||||||
|
"字节跳动": "u",
|
||||||
|
"QQ": "u"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
},
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "u"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
93
uni_modules/uni-config-center/readme.md
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
# 为什么使用uni-config-center
|
||||||
|
|
||||||
|
实际开发中很多插件需要配置文件才可以正常运行,如果每个插件都单独进行配置的话就会产生下面这样的目录结构
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cloudfunctions
|
||||||
|
└─────common 公共模块
|
||||||
|
├─plugin-a // 插件A对应的目录
|
||||||
|
│ ├─index.js
|
||||||
|
│ ├─config.json // plugin-a对应的配置文件
|
||||||
|
│ └─other-file.cert // plugin-a依赖的其他文件
|
||||||
|
└─plugin-b // plugin-b对应的目录
|
||||||
|
├─index.js
|
||||||
|
└─config.json // plugin-b对应的配置文件
|
||||||
|
```
|
||||||
|
|
||||||
|
假设插件作者要发布一个项目模板,里面使用了很多需要配置的插件,无论是作者发布还是用户使用都是一个大麻烦。
|
||||||
|
|
||||||
|
uni-config-center就是用了统一管理这些配置文件的,使用uni-config-center后的目录结构如下
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cloudfunctions
|
||||||
|
└─────common 公共模块
|
||||||
|
├─plugin-a // 插件A对应的目录
|
||||||
|
│ └─index.js
|
||||||
|
├─plugin-b // plugin-b对应的目录
|
||||||
|
│ └─index.js
|
||||||
|
└─uni-config-center
|
||||||
|
├─index.js // config-center入口文件
|
||||||
|
├─plugin-a
|
||||||
|
│ ├─config.json // plugin-a对应的配置文件
|
||||||
|
│ └─other-file.cert // plugin-a依赖的其他文件
|
||||||
|
└─plugin-b
|
||||||
|
└─config.json // plugin-b对应的配置文件
|
||||||
|
```
|
||||||
|
|
||||||
|
使用uni-config-center后的优势
|
||||||
|
|
||||||
|
- 配置文件统一管理,分离插件主体和配置信息,更新插件更方便
|
||||||
|
- 支持对config.json设置schema,插件使用者在HBuilderX内编写config.json文件时会有更好的提示(后续HBuilderX会提供支持)
|
||||||
|
|
||||||
|
# 用法
|
||||||
|
|
||||||
|
在要使用uni-config-center的公共模块或云函数内引入uni-config-center依赖,请参考:[使用公共模块](https://uniapp.dcloud.net.cn/uniCloud/cf-common)
|
||||||
|
|
||||||
|
```js
|
||||||
|
const createConfig = require('uni-config-center')
|
||||||
|
|
||||||
|
const uniIdConfig = createConfig({
|
||||||
|
pluginId: 'uni-id', // 插件id
|
||||||
|
defaultConfig: { // 默认配置
|
||||||
|
tokenExpiresIn: 7200,
|
||||||
|
tokenExpiresThreshold: 600,
|
||||||
|
},
|
||||||
|
customMerge: function(defaultConfig, userConfig) { // 自定义默认配置和用户配置的合并规则,不设置的情况侠会对默认配置和用户配置进行深度合并
|
||||||
|
// defaudltConfig 默认配置
|
||||||
|
// userConfig 用户配置
|
||||||
|
return Object.assign(defaultConfig, userConfig)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// 以如下配置为例
|
||||||
|
// {
|
||||||
|
// "tokenExpiresIn": 7200,
|
||||||
|
// "passwordErrorLimit": 6,
|
||||||
|
// "bindTokenToDevice": false,
|
||||||
|
// "passwordErrorRetryTime": 3600,
|
||||||
|
// "app-plus": {
|
||||||
|
// "tokenExpiresIn": 2592000
|
||||||
|
// },
|
||||||
|
// "service": {
|
||||||
|
// "sms": {
|
||||||
|
// "codeExpiresIn": 300
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 获取配置
|
||||||
|
uniIdConfig.config() // 获取全部配置,注意:uni-config-center内不存在对应插件目录时会返回空对象
|
||||||
|
uniIdConfig.config('tokenExpiresIn') // 指定键值获取配置,返回:7200
|
||||||
|
uniIdConfig.config('service.sms.codeExpiresIn') // 指定键值获取配置,返回:300
|
||||||
|
uniIdConfig.config('tokenExpiresThreshold', 600) // 指定键值获取配置,如果不存在则取传入的默认值,返回:600
|
||||||
|
|
||||||
|
// 获取文件绝对路径
|
||||||
|
uniIdConfig.resolve('custom-token.js') // 获取uni-config-center/uni-id/custom-token.js文件的路径
|
||||||
|
|
||||||
|
// 引用文件(require)
|
||||||
|
uniIDConfig.requireFile('custom-token.js') // 使用require方式引用uni-config-center/uni-id/custom-token.js文件。文件不存在时返回undefined,文件内有其他错误导致require失败时会抛出错误。
|
||||||
|
|
||||||
|
// 判断是否包含某文件
|
||||||
|
uniIDConfig.hasFile('custom-token.js') // 配置目录是否包含某文件,true: 文件存在,false: 文件不存在
|
||||||
|
```
|
@ -0,0 +1 @@
|
|||||||
|
{"name":"uni-config-center","version":"0.0.3","description":"配置中心","main":"index.js","keywords":[],"author":"DCloud","license":"Apache-2.0"}
|
34
uni_modules/uni-id-common/changelog.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
## 1.0.17(2024-04-26)
|
||||||
|
- 兼容uni-app-x对客户端uniPlatform的调整(uni-app-x内uniPlatform区分app-android、app-ios)
|
||||||
|
## 1.0.16(2023-04-25)
|
||||||
|
- 新增maxTokenLength配置,用于限制数据库用户记录token数组的最大长度
|
||||||
|
## 1.0.15(2023-04-06)
|
||||||
|
- 修复部分语言国际化出错的Bug
|
||||||
|
## 1.0.14(2023-03-07)
|
||||||
|
- 修复 admin用户包含其他角色时未包含在token的Bug
|
||||||
|
## 1.0.13(2022-07-21)
|
||||||
|
- 修复 创建token时未传角色权限信息生成的token不正确的bug
|
||||||
|
## 1.0.12(2022-07-15)
|
||||||
|
- 提升与旧版本uni-id的兼容性(补充读取配置文件时回退平台app-plus、h5),但是仍推荐使用新平台名进行配置(app、web)
|
||||||
|
## 1.0.11(2022-07-14)
|
||||||
|
- 修复 部分情况下报`read property 'reduce' of undefined`的错误
|
||||||
|
## 1.0.10(2022-07-11)
|
||||||
|
- 将token存储在用户表的token字段内,与旧版本uni-id保持一致
|
||||||
|
## 1.0.9(2022-07-01)
|
||||||
|
- checkToken兼容token内未缓存角色权限的情况,此时将查库获取角色权限
|
||||||
|
## 1.0.8(2022-07-01)
|
||||||
|
- 修复clientDB默认依赖时部分情况下获取不到uni-id配置的Bug
|
||||||
|
## 1.0.7(2022-06-30)
|
||||||
|
- 修复config文件不合法时未抛出具体错误的Bug
|
||||||
|
## 1.0.6(2022-06-28)
|
||||||
|
- 移除插件内的数据表schema
|
||||||
|
## 1.0.5(2022-06-27)
|
||||||
|
- 修复使用多应用配置时报`Cannot read property 'appId' of undefined`的Bug
|
||||||
|
## 1.0.4(2022-06-27)
|
||||||
|
- 修复使用自定义token内容功能报错的Bug [详情](https://ask.dcloud.net.cn/question/147945)
|
||||||
|
## 1.0.2(2022-06-23)
|
||||||
|
- 对齐旧版本uni-id默认配置
|
||||||
|
## 1.0.1(2022-06-22)
|
||||||
|
- 补充对uni-config-center的依赖
|
||||||
|
## 1.0.0(2022-06-21)
|
||||||
|
- 提供uni-id token创建、校验、刷新接口,简化旧版uni-id公共模块
|
85
uni_modules/uni-id-common/package.json
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
{
|
||||||
|
"id": "uni-id-common",
|
||||||
|
"displayName": "uni-id-common",
|
||||||
|
"version": "1.0.17",
|
||||||
|
"description": "包含uni-id token生成、校验、刷新功能的云函数公共模块",
|
||||||
|
"keywords": [
|
||||||
|
"uni-id-common",
|
||||||
|
"uniCloud",
|
||||||
|
"token",
|
||||||
|
"权限"
|
||||||
|
],
|
||||||
|
"repository": "https://gitcode.net/dcloud/uni-id-common",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": "^3.1.0"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": "",
|
||||||
|
"type": "unicloud-template-function"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": ["uni-config-center"],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y",
|
||||||
|
"alipay": "n"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "u",
|
||||||
|
"vue3": "u"
|
||||||
|
},
|
||||||
|
"App": {
|
||||||
|
"app-vue": "u",
|
||||||
|
"app-nvue": "u"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "u",
|
||||||
|
"Android Browser": "u",
|
||||||
|
"微信浏览器(Android)": "u",
|
||||||
|
"QQ浏览器(Android)": "u"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "u",
|
||||||
|
"IE": "u",
|
||||||
|
"Edge": "u",
|
||||||
|
"Firefox": "u",
|
||||||
|
"Safari": "u"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "u",
|
||||||
|
"阿里": "u",
|
||||||
|
"百度": "u",
|
||||||
|
"字节跳动": "u",
|
||||||
|
"QQ": "u",
|
||||||
|
"钉钉": "u",
|
||||||
|
"快手": "u",
|
||||||
|
"飞书": "u",
|
||||||
|
"京东": "u"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
3
uni_modules/uni-id-common/readme.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# uni-id-common
|
||||||
|
|
||||||
|
文档请参考:[uni-id-common](https://uniapp.dcloud.net.cn/uniCloud/uni-id-common.html)
|
@ -0,0 +1 @@
|
|||||||
|
{"name":"uni-id-common","version":"1.0.17","description":"uni-id token生成、校验、刷新","main":"index.js","homepage":"https://uniapp.dcloud.io/uniCloud/uni-id-common.html","repository":{"type":"git","url":"git+https://gitee.com/dcloud/uni-id-common.git"},"author":"DCloud","license":"Apache-2.0","dependencies":{"uni-config-center":"file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"}}
|
@ -0,0 +1,26 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
class BridgeError extends Error {
|
||||||
|
|
||||||
|
constructor(code, message) {
|
||||||
|
super(message)
|
||||||
|
|
||||||
|
this._code = code
|
||||||
|
}
|
||||||
|
|
||||||
|
get code() {
|
||||||
|
return this._code
|
||||||
|
}
|
||||||
|
|
||||||
|
get errCode() {
|
||||||
|
return this._code
|
||||||
|
}
|
||||||
|
|
||||||
|
get errMsg() {
|
||||||
|
return this.message
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
BridgeError
|
||||||
|
}
|
@ -0,0 +1,124 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const {
|
||||||
|
ProviderType
|
||||||
|
} = require('./consts.js')
|
||||||
|
|
||||||
|
const configCenter = require('uni-config-center')
|
||||||
|
|
||||||
|
// 多维数据为兼容uni-id以前版本配置
|
||||||
|
const OauthConfig = {
|
||||||
|
'weixin-app': [
|
||||||
|
['app', 'oauth', 'weixin'],
|
||||||
|
['app-plus', 'oauth', 'weixin']
|
||||||
|
],
|
||||||
|
'weixin-mp': [
|
||||||
|
['mp-weixin', 'oauth', 'weixin']
|
||||||
|
],
|
||||||
|
'weixin-h5': [
|
||||||
|
['web', 'oauth', 'weixin-h5'],
|
||||||
|
['h5-weixin', 'oauth', 'weixin'],
|
||||||
|
['h5', 'oauth', 'weixin']
|
||||||
|
],
|
||||||
|
'weixin-web': [
|
||||||
|
['web', 'oauth', 'weixin-web']
|
||||||
|
],
|
||||||
|
'qq-app': [
|
||||||
|
['app', 'oauth', 'qq'],
|
||||||
|
['app-plus', 'oauth', 'qq']
|
||||||
|
],
|
||||||
|
'qq-mp': [
|
||||||
|
['mp-qq', 'oauth', 'qq']
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
const Support_Platforms = [
|
||||||
|
ProviderType.WEIXIN_MP,
|
||||||
|
ProviderType.WEIXIN_H5,
|
||||||
|
ProviderType.WEIXIN_APP,
|
||||||
|
ProviderType.WEIXIN_WEB,
|
||||||
|
ProviderType.QQ_MP,
|
||||||
|
ProviderType.QQ_APP
|
||||||
|
]
|
||||||
|
|
||||||
|
class ConfigBase {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
const uniIdConfigCenter = configCenter({
|
||||||
|
pluginId: 'uni-id'
|
||||||
|
})
|
||||||
|
|
||||||
|
this._uniIdConfig = uniIdConfigCenter.config()
|
||||||
|
}
|
||||||
|
|
||||||
|
getAppConfig(appid) {
|
||||||
|
if (Array.isArray(this._uniIdConfig)) {
|
||||||
|
return this._uniIdConfig.find((item) => {
|
||||||
|
return (item.dcloudAppid === appid)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return this._uniIdConfig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AppConfig extends ConfigBase {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super()
|
||||||
|
}
|
||||||
|
|
||||||
|
get(appid, platform) {
|
||||||
|
if (!this.isSupport(platform)) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
let appConfig = this.getAppConfig(appid)
|
||||||
|
if (!appConfig) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.getOauthConfig(appConfig, platform)
|
||||||
|
}
|
||||||
|
|
||||||
|
isSupport(platformName) {
|
||||||
|
return (Support_Platforms.indexOf(platformName) >= 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
getOauthConfig(appConfig, platformName) {
|
||||||
|
let treePath = OauthConfig[platformName]
|
||||||
|
let node = this.findNode(appConfig, treePath)
|
||||||
|
if (node && node.appid && node.appsecret) {
|
||||||
|
return {
|
||||||
|
appid: node.appid,
|
||||||
|
secret: node.appsecret
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
findNode(treeNode, arrayPath) {
|
||||||
|
let node = treeNode
|
||||||
|
for (let treePath of arrayPath) {
|
||||||
|
for (let name of treePath) {
|
||||||
|
const currentNode = node[name]
|
||||||
|
if (currentNode) {
|
||||||
|
node = currentNode
|
||||||
|
} else {
|
||||||
|
node = null
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (node === null) {
|
||||||
|
node = treeNode
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
AppConfig
|
||||||
|
};
|
@ -0,0 +1,30 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const TAG = "UNI_OPEN_BRIDGE"
|
||||||
|
|
||||||
|
const HTTP_STATUS = {
|
||||||
|
SUCCESS: 200
|
||||||
|
}
|
||||||
|
|
||||||
|
const ProviderType = {
|
||||||
|
WEIXIN_MP: 'weixin-mp',
|
||||||
|
WEIXIN_H5: 'weixin-h5',
|
||||||
|
WEIXIN_APP: 'weixin-app',
|
||||||
|
WEIXIN_WEB: 'weixin-web',
|
||||||
|
QQ_MP: 'qq-mp',
|
||||||
|
QQ_APP: 'qq-app'
|
||||||
|
}
|
||||||
|
|
||||||
|
// old
|
||||||
|
const PlatformType = ProviderType
|
||||||
|
|
||||||
|
const ErrorCodeType = {
|
||||||
|
SYSTEM_ERROR: TAG + "_SYSTEM_ERROR"
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
HTTP_STATUS,
|
||||||
|
ProviderType,
|
||||||
|
PlatformType,
|
||||||
|
ErrorCodeType
|
||||||
|
}
|
@ -0,0 +1,317 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const {
|
||||||
|
PlatformType,
|
||||||
|
ProviderType,
|
||||||
|
ErrorCodeType
|
||||||
|
} = require('./consts.js')
|
||||||
|
|
||||||
|
const {
|
||||||
|
AppConfig
|
||||||
|
} = require('./config.js')
|
||||||
|
|
||||||
|
const {
|
||||||
|
Storage
|
||||||
|
} = require('./storage.js')
|
||||||
|
|
||||||
|
const {
|
||||||
|
BridgeError
|
||||||
|
} = require('./bridge-error.js')
|
||||||
|
|
||||||
|
const {
|
||||||
|
WeixinServer
|
||||||
|
} = require('./weixin-server.js')
|
||||||
|
|
||||||
|
const appConfig = new AppConfig()
|
||||||
|
|
||||||
|
class AccessToken extends Storage {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super('access-token', ['provider', 'appid'])
|
||||||
|
}
|
||||||
|
|
||||||
|
async update(key) {
|
||||||
|
super.update(key)
|
||||||
|
|
||||||
|
const result = await this.getByWeixinServer(key)
|
||||||
|
|
||||||
|
return this.set(key, result.value, result.duration)
|
||||||
|
}
|
||||||
|
|
||||||
|
async fallback(key) {
|
||||||
|
return this.getByWeixinServer(key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getByWeixinServer(key) {
|
||||||
|
const oauthConfig = appConfig.get(key.dcloudAppid, key.provider)
|
||||||
|
let methodName
|
||||||
|
if (key.provider === ProviderType.WEIXIN_MP) {
|
||||||
|
methodName = 'GetMPAccessTokenData'
|
||||||
|
} else if (key.provider === ProviderType.WEIXIN_H5) {
|
||||||
|
methodName = 'GetH5AccessTokenData'
|
||||||
|
} else {
|
||||||
|
throw new BridgeError(ErrorCodeType.SYSTEM_ERROR, "provider invalid")
|
||||||
|
}
|
||||||
|
|
||||||
|
const responseData = await WeixinServer[methodName](oauthConfig)
|
||||||
|
|
||||||
|
const duration = responseData.expires_in || (60 * 60 * 2)
|
||||||
|
delete responseData.expires_in
|
||||||
|
|
||||||
|
return {
|
||||||
|
value: responseData,
|
||||||
|
duration
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class UserAccessToken extends Storage {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super('user-access-token', ['provider', 'appid', 'openid'])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SessionKey extends Storage {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super('session-key', ['provider', 'appid', 'openid'])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Encryptkey extends Storage {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super('encrypt-key', ['provider', 'appid', 'openid'])
|
||||||
|
}
|
||||||
|
|
||||||
|
async update(key) {
|
||||||
|
super.update(key)
|
||||||
|
|
||||||
|
const result = await this.getByWeixinServer(key)
|
||||||
|
|
||||||
|
return this.set(key, result.value, result.duration)
|
||||||
|
}
|
||||||
|
|
||||||
|
getKeyString(key) {
|
||||||
|
return `${super.getKeyString(key)}-${key.version}`
|
||||||
|
}
|
||||||
|
|
||||||
|
getExpiresIn(value) {
|
||||||
|
if (value <= 0) {
|
||||||
|
return 60
|
||||||
|
}
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
async fallback(key) {
|
||||||
|
return this.getByWeixinServer(key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getByWeixinServer(key) {
|
||||||
|
const accessToken = await Factory.Get(AccessToken, key)
|
||||||
|
const userSession = await Factory.Get(SessionKey, key)
|
||||||
|
|
||||||
|
const responseData = await WeixinServer.GetUserEncryptKeyData({
|
||||||
|
openid: key.openid,
|
||||||
|
access_token: accessToken.access_token,
|
||||||
|
session_key: userSession.session_key
|
||||||
|
})
|
||||||
|
|
||||||
|
const keyInfo = responseData.key_info_list.find((item) => {
|
||||||
|
return item.version === key.version
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!keyInfo) {
|
||||||
|
throw new BridgeError(ErrorCodeType.SYSTEM_ERROR, 'key version invalid')
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = {
|
||||||
|
encrypt_key: keyInfo.encrypt_key,
|
||||||
|
iv: keyInfo.iv
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
value,
|
||||||
|
duration: keyInfo.expire_in
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Ticket extends Storage {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super('ticket', ['provider', 'appid'])
|
||||||
|
}
|
||||||
|
|
||||||
|
async update(key) {
|
||||||
|
super.update(key)
|
||||||
|
|
||||||
|
const result = await this.getByWeixinServer(key)
|
||||||
|
|
||||||
|
return this.set(key, result.value, result.duration)
|
||||||
|
}
|
||||||
|
|
||||||
|
async fallback(key) {
|
||||||
|
return this.getByWeixinServer(key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getByWeixinServer(key) {
|
||||||
|
const accessToken = await Factory.Get(AccessToken, {
|
||||||
|
dcloudAppid: key.dcloudAppid,
|
||||||
|
provider: ProviderType.WEIXIN_H5
|
||||||
|
})
|
||||||
|
|
||||||
|
const responseData = await WeixinServer.GetH5TicketData(accessToken)
|
||||||
|
|
||||||
|
const duration = responseData.expires_in || (60 * 60 * 2)
|
||||||
|
delete responseData.expires_in
|
||||||
|
delete responseData.errcode
|
||||||
|
delete responseData.errmsg
|
||||||
|
|
||||||
|
return {
|
||||||
|
value: responseData,
|
||||||
|
duration
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Factory = {
|
||||||
|
|
||||||
|
async Get(T, key, fallback) {
|
||||||
|
Factory.FixOldKey(key)
|
||||||
|
return Factory.MakeUnique(T).get(key, fallback)
|
||||||
|
},
|
||||||
|
|
||||||
|
async Set(T, key, value, expiresIn) {
|
||||||
|
Factory.FixOldKey(key)
|
||||||
|
return Factory.MakeUnique(T).set(key, value, expiresIn)
|
||||||
|
},
|
||||||
|
|
||||||
|
async Remove(T, key) {
|
||||||
|
Factory.FixOldKey(key)
|
||||||
|
return Factory.MakeUnique(T).remove(key)
|
||||||
|
},
|
||||||
|
|
||||||
|
async Update(T, key) {
|
||||||
|
Factory.FixOldKey(key)
|
||||||
|
return Factory.MakeUnique(T).update(key)
|
||||||
|
},
|
||||||
|
|
||||||
|
FixOldKey(key) {
|
||||||
|
if (!key.provider) {
|
||||||
|
key.provider = key.platform
|
||||||
|
}
|
||||||
|
|
||||||
|
const configData = appConfig.get(key.dcloudAppid, key.provider)
|
||||||
|
if (!configData) {
|
||||||
|
throw new BridgeError(ErrorCodeType.SYSTEM_ERROR, 'appid or provider invalid')
|
||||||
|
}
|
||||||
|
key.appid = configData.appid
|
||||||
|
},
|
||||||
|
|
||||||
|
MakeUnique(T) {
|
||||||
|
return new T()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// exports
|
||||||
|
|
||||||
|
async function getAccessToken(key, fallback) {
|
||||||
|
return Factory.Get(AccessToken, key, fallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setAccessToken(key, value, expiresIn) {
|
||||||
|
return Factory.Set(AccessToken, key, value, expiresIn)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function removeAccessToken(key) {
|
||||||
|
return Factory.Remove(AccessToken, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updateAccessToken(key) {
|
||||||
|
return Factory.Update(AccessToken, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getUserAccessToken(key, fallback) {
|
||||||
|
return Factory.Get(UserAccessToken, key, fallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setUserAccessToken(key, value, expiresIn) {
|
||||||
|
return Factory.Set(UserAccessToken, key, value, expiresIn)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function removeUserAccessToken(key) {
|
||||||
|
return Factory.Remove(UserAccessToken, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getSessionKey(key, fallback) {
|
||||||
|
return Factory.Get(SessionKey, key, fallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setSessionKey(key, value, expiresIn) {
|
||||||
|
return Factory.Set(SessionKey, key, value, expiresIn)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function removeSessionKey(key) {
|
||||||
|
return Factory.Remove(SessionKey, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getEncryptKey(key, fallback) {
|
||||||
|
return Factory.Get(Encryptkey, key, fallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setEncryptKey(key, value, expiresIn) {
|
||||||
|
return Factory.Set(Encryptkey, key, value, expiresIn)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function removeEncryptKey(key) {
|
||||||
|
return Factory.Remove(Encryptkey, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updateEncryptKey(key) {
|
||||||
|
return Factory.Update(Encryptkey, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getTicket(key, fallback) {
|
||||||
|
return Factory.Get(Ticket, key, fallback)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function setTicket(key, value, expiresIn) {
|
||||||
|
return Factory.Set(Ticket, key, value, expiresIn)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function removeTicket(key) {
|
||||||
|
return Factory.Remove(Ticket, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updateTicket(key) {
|
||||||
|
return Factory.Update(Ticket, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
getAccessToken,
|
||||||
|
setAccessToken,
|
||||||
|
removeAccessToken,
|
||||||
|
updateAccessToken,
|
||||||
|
getUserAccessToken,
|
||||||
|
setUserAccessToken,
|
||||||
|
removeUserAccessToken,
|
||||||
|
getSessionKey,
|
||||||
|
setSessionKey,
|
||||||
|
removeSessionKey,
|
||||||
|
getEncryptKey,
|
||||||
|
setEncryptKey,
|
||||||
|
removeEncryptKey,
|
||||||
|
updateEncryptKey,
|
||||||
|
getTicket,
|
||||||
|
setTicket,
|
||||||
|
removeTicket,
|
||||||
|
updateTicket,
|
||||||
|
ProviderType,
|
||||||
|
PlatformType,
|
||||||
|
WeixinServer,
|
||||||
|
ErrorCodeType
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "uni-open-bridge-common",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"uni-config-center": "file:../../../../../uni-config-center/uniCloud/cloudfunctions/common/uni-config-center"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,111 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const {
|
||||||
|
Validator
|
||||||
|
} = require('./validator.js')
|
||||||
|
|
||||||
|
const {
|
||||||
|
CacheKeyCascade
|
||||||
|
} = require('./uni-cloud-cache.js')
|
||||||
|
|
||||||
|
const {
|
||||||
|
BridgeError
|
||||||
|
} = require('./bridge-error.js')
|
||||||
|
|
||||||
|
class Storage {
|
||||||
|
|
||||||
|
constructor(type, keys) {
|
||||||
|
this._type = type || null
|
||||||
|
this._keys = keys || []
|
||||||
|
}
|
||||||
|
|
||||||
|
async get(key, fallback) {
|
||||||
|
this.validateKey(key)
|
||||||
|
const result = await this.create(key, fallback).get()
|
||||||
|
return result.value
|
||||||
|
}
|
||||||
|
|
||||||
|
async set(key, value, expiresIn) {
|
||||||
|
this.validateKey(key)
|
||||||
|
this.validateValue(value)
|
||||||
|
const expires_in = this.getExpiresIn(expiresIn)
|
||||||
|
if (expires_in !== 0) {
|
||||||
|
await this.create(key).set(this.getValue(value), expires_in)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async remove(key) {
|
||||||
|
this.validateKey(key)
|
||||||
|
await this.create(key).remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
// virtual
|
||||||
|
async update(key) {
|
||||||
|
this.validateKey(key)
|
||||||
|
}
|
||||||
|
|
||||||
|
async ttl(key) {
|
||||||
|
this.validateKey(key)
|
||||||
|
// 后续考虑支持
|
||||||
|
}
|
||||||
|
|
||||||
|
async fallback(key) {}
|
||||||
|
|
||||||
|
getKeyString(key) {
|
||||||
|
const keyArray = [Storage.Prefix]
|
||||||
|
this._keys.forEach((name) => {
|
||||||
|
keyArray.push(key[name])
|
||||||
|
})
|
||||||
|
keyArray.push(this._type)
|
||||||
|
return keyArray.join(':')
|
||||||
|
}
|
||||||
|
|
||||||
|
getValue(value) {
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
|
getExpiresIn(value) {
|
||||||
|
if (value !== undefined) {
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
validateKey(key) {
|
||||||
|
Validator.Key(this._keys, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
validateValue(value) {
|
||||||
|
Validator.Value(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
create(key, fallback) {
|
||||||
|
const keyString = this.getKeyString(key)
|
||||||
|
const options = {
|
||||||
|
layers: [{
|
||||||
|
type: 'database',
|
||||||
|
key: keyString
|
||||||
|
}, {
|
||||||
|
type: 'redis',
|
||||||
|
key: keyString
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
const _this = this
|
||||||
|
return new CacheKeyCascade({
|
||||||
|
...options,
|
||||||
|
fallback: async function() {
|
||||||
|
if (fallback) {
|
||||||
|
return fallback(key)
|
||||||
|
} else if (_this.fallback) {
|
||||||
|
return _this.fallback(key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Storage.Prefix = "uni-id"
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
Storage
|
||||||
|
};
|
@ -0,0 +1,324 @@
|
|||||||
|
const db = uniCloud.database()
|
||||||
|
|
||||||
|
function getType(value) {
|
||||||
|
return Object.prototype.toString.call(value).slice(8, -1).toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
const validator = {
|
||||||
|
key: function(value) {
|
||||||
|
const err = new Error('Invalid key')
|
||||||
|
if (typeof value !== 'string') {
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
const valueTrim = value.trim()
|
||||||
|
if (!valueTrim || valueTrim !== value) {
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
},
|
||||||
|
value: function(value) {
|
||||||
|
// 仅作简单校验
|
||||||
|
const type = getType(value)
|
||||||
|
const validValueType = ['null', 'number', 'string', 'array', 'object']
|
||||||
|
if (validValueType.indexOf(type) === -1) {
|
||||||
|
throw new Error('Invalid value type')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
duration: function(value) {
|
||||||
|
const err = new Error('Invalid duration')
|
||||||
|
if (value === undefined) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (typeof value !== 'number' || value === 0) {
|
||||||
|
throw err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库时 expired 为过期时间对应的时间戳,永不过期用-1表示
|
||||||
|
* 返回结果时 与redis对齐,-1表示永不过期,-2表示已过期或不存在
|
||||||
|
*/
|
||||||
|
class DatabaseCache {
|
||||||
|
constructor({
|
||||||
|
collection = 'opendb-open-data'
|
||||||
|
} = {}) {
|
||||||
|
this.type = 'db'
|
||||||
|
this.collection = db.collection(collection)
|
||||||
|
}
|
||||||
|
|
||||||
|
_serializeValue(value) {
|
||||||
|
return value === undefined ? null : JSON.stringify(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
_deserializeValue(value) {
|
||||||
|
return value ? JSON.parse(value) : value
|
||||||
|
}
|
||||||
|
|
||||||
|
async set(key, value, duration) {
|
||||||
|
validator.key(key)
|
||||||
|
validator.value(value)
|
||||||
|
validator.duration(duration)
|
||||||
|
value = this._serializeValue(value)
|
||||||
|
await this.collection.doc(key).set({
|
||||||
|
value,
|
||||||
|
expired: duration && duration !== -1 ? Date.now() + (duration * 1000) : -1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
async _getWithDuration(key) {
|
||||||
|
const getKeyRes = await this.collection.doc(key).get()
|
||||||
|
const record = getKeyRes.data[0]
|
||||||
|
if (!record) {
|
||||||
|
return {
|
||||||
|
value: null,
|
||||||
|
duration: -2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const value = this._deserializeValue(record.value)
|
||||||
|
const expired = record.expired
|
||||||
|
if (expired === -1) {
|
||||||
|
return {
|
||||||
|
value,
|
||||||
|
duration: -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const duration = expired - Date.now()
|
||||||
|
if (duration <= 0) {
|
||||||
|
await this.remove(key)
|
||||||
|
return {
|
||||||
|
value: null,
|
||||||
|
duration: -2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
value,
|
||||||
|
duration: Math.floor(duration / 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async get(key, {
|
||||||
|
withDuration = true
|
||||||
|
} = {}) {
|
||||||
|
const result = await this._getWithDuration(key)
|
||||||
|
if (!withDuration) {
|
||||||
|
delete result.duration
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
async remove(key) {
|
||||||
|
await this.collection.doc(key).remove()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class RedisCache {
|
||||||
|
constructor() {
|
||||||
|
this.type = 'redis'
|
||||||
|
this.redis = uniCloud.redis()
|
||||||
|
}
|
||||||
|
|
||||||
|
_serializeValue(value) {
|
||||||
|
return value === undefined ? null : JSON.stringify(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
_deserializeValue(value) {
|
||||||
|
return value ? JSON.parse(value) : value
|
||||||
|
}
|
||||||
|
|
||||||
|
async set(key, value, duration) {
|
||||||
|
validator.key(key)
|
||||||
|
validator.value(value)
|
||||||
|
validator.duration(duration)
|
||||||
|
value = this._serializeValue(value)
|
||||||
|
if (!duration || duration === -1) {
|
||||||
|
await this.redis.set(key, value)
|
||||||
|
} else {
|
||||||
|
await this.redis.set(key, value, 'EX', duration)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async get(key, {
|
||||||
|
withDuration = false
|
||||||
|
} = {}) {
|
||||||
|
let value = await this.redis.get(key)
|
||||||
|
value = this._deserializeValue(value)
|
||||||
|
if (!withDuration) {
|
||||||
|
return {
|
||||||
|
value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const durationSecond = await this.redis.ttl(key)
|
||||||
|
let duration
|
||||||
|
switch (durationSecond) {
|
||||||
|
case -1:
|
||||||
|
duration = -1
|
||||||
|
break
|
||||||
|
case -2:
|
||||||
|
duration = -2
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
duration = durationSecond
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
value,
|
||||||
|
duration
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async remove(key) {
|
||||||
|
await this.redis.del(key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Cache {
|
||||||
|
constructor({
|
||||||
|
type,
|
||||||
|
collection
|
||||||
|
} = {}) {
|
||||||
|
if (type === 'database') {
|
||||||
|
return new DatabaseCache({
|
||||||
|
collection
|
||||||
|
})
|
||||||
|
} else if (type === 'redis') {
|
||||||
|
return new RedisCache()
|
||||||
|
} else {
|
||||||
|
throw new Error('Invalid cache type')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CacheKey {
|
||||||
|
constructor({
|
||||||
|
type,
|
||||||
|
collection,
|
||||||
|
cache,
|
||||||
|
key,
|
||||||
|
fallback
|
||||||
|
} = {}) {
|
||||||
|
this.cache = cache || new Cache({
|
||||||
|
type,
|
||||||
|
collection
|
||||||
|
})
|
||||||
|
this.key = key
|
||||||
|
this.fallback = fallback
|
||||||
|
}
|
||||||
|
|
||||||
|
async set(value, duration) {
|
||||||
|
await this.cache.set(this.key, value, duration)
|
||||||
|
}
|
||||||
|
|
||||||
|
async setWithSync(value, duration, syncMethod) {
|
||||||
|
await Promise.all([
|
||||||
|
this.set(this.key, value, duration),
|
||||||
|
syncMethod(value, duration)
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
async get() {
|
||||||
|
let {
|
||||||
|
value,
|
||||||
|
duration
|
||||||
|
} = await this.cache.get(this.key)
|
||||||
|
if (value !== null && value !== undefined) {
|
||||||
|
return {
|
||||||
|
value,
|
||||||
|
duration
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!this.fallback) {
|
||||||
|
return {
|
||||||
|
value: null,
|
||||||
|
duration: -2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const fallbackResult = await this.fallback()
|
||||||
|
value = fallbackResult.value
|
||||||
|
duration = fallbackResult.duration
|
||||||
|
if (value !== null && duration !== undefined) {
|
||||||
|
await this.cache.set(this.key, value, duration)
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
value,
|
||||||
|
duration
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async remove() {
|
||||||
|
await this.cache.remove(this.key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CacheKeyCascade {
|
||||||
|
constructor({
|
||||||
|
layers, // [{cache, type, collection, key}] 从低级到高级排序,[DbCacheKey, RedisCacheKey]
|
||||||
|
fallback
|
||||||
|
} = {}) {
|
||||||
|
this.layers = layers
|
||||||
|
this.cacheLayers = []
|
||||||
|
let lastCacheKey
|
||||||
|
for (let i = 0; i < layers.length; i++) {
|
||||||
|
const {
|
||||||
|
type,
|
||||||
|
cache,
|
||||||
|
collection,
|
||||||
|
key
|
||||||
|
} = layers[i]
|
||||||
|
const lastCacheKeyTemp = lastCacheKey
|
||||||
|
try {
|
||||||
|
const currentCacheKey = new CacheKey({
|
||||||
|
type,
|
||||||
|
collection,
|
||||||
|
cache,
|
||||||
|
key,
|
||||||
|
fallback: i === 0 ? fallback : function() {
|
||||||
|
return lastCacheKeyTemp.get()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.cacheLayers.push(currentCacheKey)
|
||||||
|
lastCacheKey = currentCacheKey
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
this.highLevelCache = lastCacheKey
|
||||||
|
}
|
||||||
|
|
||||||
|
async set(value, duration) {
|
||||||
|
return Promise.all(
|
||||||
|
this.cacheLayers.map(item => {
|
||||||
|
return item.set(value, duration)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
async setWithSync(value, duration, syncMethod) {
|
||||||
|
const setPromise = this.cacheLayers.map(item => {
|
||||||
|
return item.set(value, duration)
|
||||||
|
})
|
||||||
|
return Promise.all(
|
||||||
|
[
|
||||||
|
...setPromise,
|
||||||
|
syncMethod(value, duration)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
async get() {
|
||||||
|
return this.highLevelCache.get()
|
||||||
|
}
|
||||||
|
|
||||||
|
async remove() {
|
||||||
|
await Promise.all(
|
||||||
|
this.cacheLayers.map(cacheKeyItem => {
|
||||||
|
return cacheKeyItem.remove()
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
Cache,
|
||||||
|
DatabaseCache,
|
||||||
|
RedisCache,
|
||||||
|
CacheKey,
|
||||||
|
CacheKeyCascade
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
const Validator = {
|
||||||
|
|
||||||
|
Key(keyArray, parameters) {
|
||||||
|
for (let i = 0; i < keyArray.length; i++) {
|
||||||
|
const keyName = keyArray[i]
|
||||||
|
if (typeof parameters[keyName] !== 'string') {
|
||||||
|
Validator.ThrowNewError(`Invalid ${keyName}`)
|
||||||
|
}
|
||||||
|
if (parameters[keyName].length < 1) {
|
||||||
|
Validator.ThrowNewError(`Invalid ${keyName}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
Value(value) {
|
||||||
|
if (value === undefined) {
|
||||||
|
Validator.ThrowNewError('Invalid Value')
|
||||||
|
}
|
||||||
|
if (typeof value !== 'object') {
|
||||||
|
Validator.ThrowNewError('Invalid Value Type')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
ThrowNewError(message) {
|
||||||
|
throw new Error(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
Validator
|
||||||
|
}
|
@ -0,0 +1,203 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const crypto = require('crypto')
|
||||||
|
|
||||||
|
const {
|
||||||
|
HTTP_STATUS
|
||||||
|
} = require('./consts.js')
|
||||||
|
|
||||||
|
const {
|
||||||
|
BridgeError
|
||||||
|
} = require('./bridge-error.js')
|
||||||
|
|
||||||
|
class WeixinServer {
|
||||||
|
|
||||||
|
constructor(options = {}) {
|
||||||
|
this._appid = options.appid
|
||||||
|
this._secret = options.secret
|
||||||
|
}
|
||||||
|
|
||||||
|
getAccessToken() {
|
||||||
|
return uniCloud.httpclient.request(WeixinServer.AccessToken_Url, {
|
||||||
|
dataType: 'json',
|
||||||
|
method: 'POST',
|
||||||
|
contentType: 'json',
|
||||||
|
data: {
|
||||||
|
appid: this._appid,
|
||||||
|
secret: this._secret,
|
||||||
|
grant_type: "client_credential"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用客户端获取的 code 从微信服务器换取 openid,code 仅可使用一次
|
||||||
|
codeToSession(code) {
|
||||||
|
return uniCloud.httpclient.request(WeixinServer.Code2Session_Url, {
|
||||||
|
dataType: 'json',
|
||||||
|
data: {
|
||||||
|
appid: this._appid,
|
||||||
|
secret: this._secret,
|
||||||
|
js_code: code,
|
||||||
|
grant_type: 'authorization_code'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getUserEncryptKey({
|
||||||
|
access_token,
|
||||||
|
openid,
|
||||||
|
session_key
|
||||||
|
}) {
|
||||||
|
console.log(access_token, openid, session_key);
|
||||||
|
const signature = crypto.createHmac('sha256', session_key).update('').digest('hex')
|
||||||
|
return uniCloud.httpclient.request(WeixinServer.User_Encrypt_Key_Url, {
|
||||||
|
dataType: 'json',
|
||||||
|
method: 'POST',
|
||||||
|
dataAsQueryString: true,
|
||||||
|
data: {
|
||||||
|
access_token,
|
||||||
|
openid: openid,
|
||||||
|
signature: signature,
|
||||||
|
sig_method: 'hmac_sha256'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getH5AccessToken() {
|
||||||
|
return uniCloud.httpclient.request(WeixinServer.AccessToken_H5_Url, {
|
||||||
|
dataType: 'json',
|
||||||
|
method: 'GET',
|
||||||
|
data: {
|
||||||
|
appid: this._appid,
|
||||||
|
secret: this._secret,
|
||||||
|
grant_type: "client_credential"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getH5Ticket(access_token) {
|
||||||
|
return uniCloud.httpclient.request(WeixinServer.Ticket_Url, {
|
||||||
|
dataType: 'json',
|
||||||
|
dataAsQueryString: true,
|
||||||
|
method: 'POST',
|
||||||
|
data: {
|
||||||
|
access_token
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getH5AccessTokenForEip() {
|
||||||
|
return uniCloud.httpProxyForEip.postForm(WeixinServer.AccessToken_H5_Url, {
|
||||||
|
appid: this._appid,
|
||||||
|
secret: this._secret,
|
||||||
|
grant_type: "client_credential"
|
||||||
|
}, {
|
||||||
|
dataType: 'json'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getH5TicketForEip(access_token) {
|
||||||
|
return uniCloud.httpProxyForEip.postForm(WeixinServer.Ticket_Url, {
|
||||||
|
access_token
|
||||||
|
}, {
|
||||||
|
dataType: 'json',
|
||||||
|
dataAsQueryString: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.AccessToken_Url = 'https://api.weixin.qq.com/cgi-bin/stable_token'
|
||||||
|
WeixinServer.Code2Session_Url = 'https://api.weixin.qq.com/sns/jscode2session'
|
||||||
|
WeixinServer.User_Encrypt_Key_Url = 'https://api.weixin.qq.com/wxa/business/getuserencryptkey'
|
||||||
|
WeixinServer.AccessToken_H5_Url = 'https://api.weixin.qq.com/cgi-bin/token'
|
||||||
|
WeixinServer.Ticket_Url = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi'
|
||||||
|
|
||||||
|
WeixinServer.GetMPAccessToken = function(options) {
|
||||||
|
return new WeixinServer(options).getAccessToken()
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetCodeToSession = function(options) {
|
||||||
|
return new WeixinServer(options).codeToSession(options.code)
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetUserEncryptKey = function(options) {
|
||||||
|
return new WeixinServer(options).getUserEncryptKey(options)
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetH5AccessToken = function(options) {
|
||||||
|
return new WeixinServer(options).getH5AccessToken()
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetH5Ticket = function(options) {
|
||||||
|
return new WeixinServer(options).getH5Ticket(options.access_token)
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
function isAliyun() {
|
||||||
|
return (uniCloud.getCloudInfos()[0].provider === 'aliyun')
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetResponseData = function(response) {
|
||||||
|
console.log("WeixinServer::response", response)
|
||||||
|
|
||||||
|
if (!(response.status === HTTP_STATUS.SUCCESS || response.statusCodeValue === HTTP_STATUS.SUCCESS)) {
|
||||||
|
throw new BridgeError(response.status || response.statusCodeValue, response.status || response.statusCodeValue)
|
||||||
|
}
|
||||||
|
|
||||||
|
const responseData = response.data || response.body
|
||||||
|
|
||||||
|
if (responseData.errcode !== undefined && responseData.errcode !== 0) {
|
||||||
|
throw new BridgeError(responseData.errcode, responseData.errmsg)
|
||||||
|
}
|
||||||
|
|
||||||
|
return responseData
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetMPAccessTokenData = async function(options) {
|
||||||
|
const response = await new WeixinServer(options).getAccessToken()
|
||||||
|
return WeixinServer.GetResponseData(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetCodeToSessionData = async function(options) {
|
||||||
|
const response = await new WeixinServer(options).codeToSession(options.code)
|
||||||
|
return WeixinServer.GetResponseData(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetUserEncryptKeyData = async function(options) {
|
||||||
|
const response = await new WeixinServer(options).getUserEncryptKey(options)
|
||||||
|
return WeixinServer.GetResponseData(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetH5AccessTokenData = async function(options) {
|
||||||
|
const ws = new WeixinServer(options)
|
||||||
|
let response
|
||||||
|
if (isAliyun()) {
|
||||||
|
response = await ws.getH5AccessTokenForEip()
|
||||||
|
if (typeof response === 'string') {
|
||||||
|
response = JSON.parse(response)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
response = await ws.getH5AccessToken()
|
||||||
|
}
|
||||||
|
return WeixinServer.GetResponseData(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
WeixinServer.GetH5TicketData = async function(options) {
|
||||||
|
const ws = new WeixinServer(options)
|
||||||
|
let response
|
||||||
|
if (isAliyun()) {
|
||||||
|
response = await ws.getH5TicketForEip(options.access_token)
|
||||||
|
if (typeof response === 'string') {
|
||||||
|
response = JSON.parse(response)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
response = await ws.getH5Ticket(options.access_token)
|
||||||
|
}
|
||||||
|
return WeixinServer.GetResponseData(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
WeixinServer
|
||||||
|
}
|
@ -1,3 +1,6 @@
|
|||||||
|
import {
|
||||||
|
Toast
|
||||||
|
} from "../libs/uniApi";
|
||||||
import {
|
import {
|
||||||
getGXconfig,
|
getGXconfig,
|
||||||
miniapp
|
miniapp
|
||||||
@ -32,11 +35,8 @@ function compareVersions(version1, version2) {
|
|||||||
const loadMP = async (id) => {
|
const loadMP = async (id) => {
|
||||||
appid = id;
|
appid = id;
|
||||||
let info = await getGXconfig();
|
let info = await getGXconfig();
|
||||||
console.log('最新版本', info.data);
|
|
||||||
// return ;
|
|
||||||
uni.$emit('showLoading', true, '初始化中');
|
uni.$emit('showLoading', true, '初始化中');
|
||||||
mp.getUniMPVersion(id, (ret) => {
|
mp.getUniMPVersion(id, (ret) => {
|
||||||
console.log('当前版本', ret);
|
|
||||||
let flag;
|
let flag;
|
||||||
if (ENV == 'prod') {
|
if (ENV == 'prod') {
|
||||||
flag = false
|
flag = false
|
||||||
@ -47,14 +47,15 @@ const loadMP = async (id) => {
|
|||||||
true) {
|
true) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
if (count < 100 && count > 0) uni.$emit('showLoading', true, `初始化中... ${count}%`)
|
if (count < 100 && count > 0) uni.$emit('showLoading', true,
|
||||||
|
`初始化中... ${count}%`)
|
||||||
else uni.$emit('showLoading', true, `初始化中... 99%`)
|
else uni.$emit('showLoading', true, `初始化中... 99%`)
|
||||||
}, 200)
|
}, 200)
|
||||||
let downloadTask = uni.downloadFile({
|
let downloadTask = uni.downloadFile({
|
||||||
url: info.data.version_info?.dow_url,
|
url: info.data.version_info?.dow_url,
|
||||||
|
// url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/36e40202405031202367449.wgt",
|
||||||
success(res) {
|
success(res) {
|
||||||
wgtFile = res.tempFilePath;
|
wgtFile = res.tempFilePath;
|
||||||
console.log('初始化完成', wgtFile);
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
installMP();
|
installMP();
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
@ -103,12 +104,13 @@ const loadMPx = async (id) => {
|
|||||||
true) {
|
true) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
if (count < 100 && count > 0) uni.$emit('showLoading', true, `初始化中... ${count}%`)
|
if (count < 100 && count > 0) uni.$emit('showLoading', true,
|
||||||
|
`初始化中... ${count}%`)
|
||||||
else uni.$emit('showLoading', true, `初始化中... 99%`)
|
else uni.$emit('showLoading', true, `初始化中... 99%`)
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
let downloadTask = uni.downloadFile({
|
let downloadTask = uni.downloadFile({
|
||||||
url: info.data.appInfo.dow_url,
|
url: './__UNI__7626C0F.wgt',
|
||||||
success(res) {
|
success(res) {
|
||||||
wgtFile = res.tempFilePath;
|
wgtFile = res.tempFilePath;
|
||||||
console.log('初始化完成', wgtFile);
|
console.log('初始化完成', wgtFile);
|
||||||
@ -125,7 +127,6 @@ const loadMPx = async (id) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
downloadTask.onProgressUpdate((res) => {
|
downloadTask.onProgressUpdate((res) => {
|
||||||
// console.log('初始化进度' + res.progress);
|
|
||||||
if (res.progress > count) count += 10;
|
if (res.progress > count) count += 10;
|
||||||
if (count >= 90) {
|
if (count >= 90) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
@ -155,11 +156,13 @@ const loadMPurl = async (e) => {
|
|||||||
} else {
|
} else {
|
||||||
flag = true
|
flag = true
|
||||||
}
|
}
|
||||||
if (0 != ret.code || compareVersions(fileInfo.data?.data?.version, ret.versionInfo.name) == 1 || flag ==
|
if (0 != ret.code || compareVersions(fileInfo.data?.data?.version, ret
|
||||||
|
.versionInfo.name) == 1 || flag ==
|
||||||
true) {
|
true) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
if (count < 100 && count > 0) uni.$emit('showLoading', true, `初始化中... ${count}%`)
|
if (count < 100 && count > 0) uni.$emit('showLoading', true,
|
||||||
|
`初始化中... ${count}%`)
|
||||||
else uni.$emit('showLoading', true, `初始化中... 99%`)
|
else uni.$emit('showLoading', true, `初始化中... 99%`)
|
||||||
}, 200)
|
}, 200)
|
||||||
let downloadTask = uni.downloadFile({
|
let downloadTask = uni.downloadFile({
|
||||||
@ -202,6 +205,8 @@ const loadMPurl = async (e) => {
|
|||||||
|
|
||||||
// 商城配置的小程序
|
// 商城配置的小程序
|
||||||
const loadAppletMP = async (data) => {
|
const loadAppletMP = async (data) => {
|
||||||
|
// console.log(data)
|
||||||
|
// return
|
||||||
appid = data.app_id;
|
appid = data.app_id;
|
||||||
// return ;
|
// return ;
|
||||||
uni.$emit('showLoading', true, '初始化中');
|
uni.$emit('showLoading', true, '初始化中');
|
||||||
@ -212,20 +217,30 @@ const loadAppletMP = async (data) => {
|
|||||||
} else {
|
} else {
|
||||||
flag = true
|
flag = true
|
||||||
}
|
}
|
||||||
|
if (data.showToast) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '正在加载中...'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (0 != ret.code || compareVersions(data.version, ret.versionInfo.name) == 1 || flag ==
|
if (0 != ret.code || compareVersions(data.version, ret.versionInfo.name) == 1 || flag ==
|
||||||
true) {
|
true) {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
timer = setInterval(() => {
|
timer = setInterval(() => {
|
||||||
if (count < 100 && count > 0) uni.$emit('showLoading', true, `初始化中... ${count}%`)
|
if (count < 100 && count > 0) uni.$emit('showLoading', true,
|
||||||
|
`初始化中... ${count}%`)
|
||||||
else uni.$emit('showLoading', true, `初始化中... 99%`)
|
else uni.$emit('showLoading', true, `初始化中... 99%`)
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
|
|
||||||
let downloadTask = uni.downloadFile({
|
let downloadTask = uni.downloadFile({
|
||||||
url: data.url,
|
url: data.url,
|
||||||
|
// url: "https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/3ffde202405031254278460.wgt",
|
||||||
success(res) {
|
success(res) {
|
||||||
wgtFile = res.tempFilePath;
|
wgtFile = res.tempFilePath;
|
||||||
console.log('初始化完成', wgtFile);
|
console.log('初始化完成', wgtFile);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
installMP();
|
installMP(data);
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
timer = null;
|
timer = null;
|
||||||
}, 700)
|
}, 700)
|
||||||
@ -237,7 +252,6 @@ const loadAppletMP = async (data) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
downloadTask.onProgressUpdate((res) => {
|
downloadTask.onProgressUpdate((res) => {
|
||||||
// console.log('初始化进度' + res.progress);
|
|
||||||
if (res.progress > count) count += 10;
|
if (res.progress > count) count += 10;
|
||||||
if (count >= 90) {
|
if (count >= 90) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
@ -278,7 +292,6 @@ const loadMPdns = async (e) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
downloadTask.onProgressUpdate((res) => {
|
downloadTask.onProgressUpdate((res) => {
|
||||||
// console.log('初始化进度' + res.progress);
|
|
||||||
if (res.progress > count) count += 10;
|
if (res.progress > count) count += 10;
|
||||||
if (count >= 90) {
|
if (count >= 90) {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
@ -298,19 +311,19 @@ const getVersion = (id) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 初始化小程序
|
// 初始化小程序
|
||||||
const installMP = () => {
|
const installMP = (data) => {
|
||||||
mp.getUniMPVersion(appid, (ret) => {
|
mp.getUniMPVersion(appid, (ret) => {
|
||||||
doInstallMP();
|
doInstallMP(data);
|
||||||
console.log('getUniMPVersion: ' + JSON.stringify(ret));
|
console.log('getUniMPVersion: ' + JSON.stringify(ret));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const doInstallMP = () => {
|
const doInstallMP = (data) => {
|
||||||
mp.installUniMP({
|
mp.installUniMP({
|
||||||
appid: appid,
|
appid: appid,
|
||||||
wgtFile: wgtFile
|
wgtFile: wgtFile
|
||||||
}, (r) => {
|
}, (r) => {
|
||||||
if (0 == r.code) {
|
if (0 == r.code) {
|
||||||
open();
|
open(data);
|
||||||
} else {
|
} else {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
@ -326,6 +339,7 @@ const doInstallMP = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const open = (id = null) => {
|
const open = (id = null) => {
|
||||||
|
uni.hideLoading()
|
||||||
uni.$emit('showLoading', false);
|
uni.$emit('showLoading', false);
|
||||||
let token = uni.getStorageSync('LOGIN_STATUS_TOKEN');
|
let token = uni.getStorageSync('LOGIN_STATUS_TOKEN');
|
||||||
if (!token) return uni.showToast({
|
if (!token) return uni.showToast({
|
||||||
@ -334,13 +348,12 @@ const open = (id = null) => {
|
|||||||
})
|
})
|
||||||
let avatar = store?.state?.userInfo?.avatar;
|
let avatar = store?.state?.userInfo?.avatar;
|
||||||
mp.openUniMP({
|
mp.openUniMP({
|
||||||
appid: id || appid,
|
appid: typeof(id) == 'object' ? appid : (id || appid),
|
||||||
extraData: {
|
extraData: {
|
||||||
uniMP: true,
|
uniMP: true,
|
||||||
token: token,
|
token: token,
|
||||||
avatar: avatar,
|
avatar: avatar,
|
||||||
},
|
},
|
||||||
// path: '/pages/index/index?unimp=true'
|
|
||||||
}, (ret) => {
|
}, (ret) => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (0 != ret.code) {
|
if (0 != ret.code) {
|
||||||
@ -350,7 +363,16 @@ const open = (id = null) => {
|
|||||||
showCancel: false
|
showCancel: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
console.log('openUniMP: ' + JSON.stringify(ret));
|
|
||||||
|
if (id.type == 2) {
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log("发送给小程序的", id)
|
||||||
|
mp.sendUniMPEvent(appid, 'tocustomlist', id, (ret) => {
|
||||||
|
console.log("开始发送消息")
|
||||||
|
});
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,10 +4,9 @@ import {
|
|||||||
test
|
test
|
||||||
} from "@/utils/uniMPfunction.js"
|
} from "@/utils/uniMPfunction.js"
|
||||||
|
|
||||||
export const initEvent = () => {
|
export const initEvent = (data) => {
|
||||||
mp.onUniMPEventReceive(async (ret) => {
|
mp.onUniMPEventReceive(async (ret) => {
|
||||||
console.log('小程序事件: ', ret);
|
console.log('小程序事件: ', data);
|
||||||
|
|
||||||
// 用户如果没有注册商户 从小程序返回 入驻页面
|
// 用户如果没有注册商户 从小程序返回 入驻页面
|
||||||
if (ret.event == 'closeAppToOpenShop') {
|
if (ret.event == 'closeAppToOpenShop') {
|
||||||
mp.closeUniMP(ret.fromAppid, (ret) => {
|
mp.closeUniMP(ret.fromAppid, (ret) => {
|
||||||
@ -34,20 +33,6 @@ export const initEvent = () => {
|
|||||||
console.log('获取定位');
|
console.log('获取定位');
|
||||||
let res = await uniMPgetLocation();
|
let res = await uniMPgetLocation();
|
||||||
console.log(res);
|
console.log(res);
|
||||||
// plus.geolocation.getCurrentPosition(function(position) {
|
|
||||||
// console.log('经度:' + position.coords.longitude);
|
|
||||||
// console.log('纬度:' + position.coords.latitude);
|
|
||||||
// // that.markers[1].latitude = position.coords.longitude;
|
|
||||||
// // that.markers[1].longitude = position.coords.longitude;
|
|
||||||
// mp.sendUniMPEvent(
|
|
||||||
// ret.fromAppid,
|
|
||||||
// 'getLocation', {...position.coords},
|
|
||||||
// (ret) => {
|
|
||||||
// console.log('Host sendEvent: ' + JSON.stringify(ret));
|
|
||||||
// });
|
|
||||||
// }, function(error) {
|
|
||||||
// console.error('获取位置失败:', error.message);
|
|
||||||
// }, {provider:'gps'});
|
|
||||||
mp.sendUniMPEvent(
|
mp.sendUniMPEvent(
|
||||||
ret.fromAppid,
|
ret.fromAppid,
|
||||||
'getLocation', {
|
'getLocation', {
|
||||||
@ -72,6 +57,10 @@ export const initEvent = () => {
|
|||||||
console.log('Host sendEvent: ' + JSON.stringify(ret));
|
console.log('Host sendEvent: ' + JSON.stringify(ret));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (ret.event == 'log') {
|
if (ret.event == 'log') {
|
||||||
// console.log('2222222')
|
// console.log('2222222')
|
||||||
|
|
||||||
|