学习很差啦 2022-09-14 10:51:18 +08:00
commit 5afc5477a9
13 changed files with 108 additions and 35 deletions

View File

@ -8,7 +8,7 @@
<view class="share-list"> <view class="share-list">
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view class="share-item"> <view class="share-item">
<button class="share-btn" open-type="share"> <button class="share-btn" @click="weChatShare" open-type="share">
<u-icon color="#04BE02" size="80" name="weixin-fill"></u-icon> <u-icon color="#04BE02" size="80" name="weixin-fill"></u-icon>
</button> </button>
</view> </view>
@ -62,6 +62,16 @@ export default {
close() { close() {
this.$emit("close"); this.$emit("close");
}, },
weChatShare(){
this.$u.mpShare = {
title: this.shareTitle(), //
path: '', // QQ
//
// PNGJPG
imageUrl: this.thumbnail ||''
}
},
// h5 // h5
// #ifdef H5 // #ifdef H5
copyLink() { copyLink() {
@ -93,13 +103,13 @@ export default {
shareTitle() { shareTitle() {
let shareTitle; let shareTitle;
if (this.type == "goods") { if (this.type == "goods") {
shareTitle = `我发现了一个${this.goodsName}商品快来跟我一起看看吧`; shareTitle = `[好友推荐]${this.goodsName}快来跟我一起看看吧`;
} else if (this.type == "shops") { } else if (this.type == "shops") {
shareTitle = `我发现了一个${this.goodsName}店铺快来跟我一起看看吧`; shareTitle = `[好友发现]${this.goodsName}快来跟我一起看看吧`;
} else if (this.type == "pintuan") { } else if (this.type == "pintuan") {
shareTitle = `我拼了一个${this.goodsName}快来跟我一起抢购吧!`; shareTitle = `[好友邀请]${this.goodsName}快来跟我一起抢购吧!`;
} else if (this.type == "kanjia") { } else if (this.type == "kanjia") {
shareTitle = `请快来帮我砍一刀${this.goodsName}`; shareTitle = `[好友邀请]请快来帮我砍一刀${this.goodsName}`;
} }
return shareTitle; return shareTitle;
}, },

View File

@ -16,6 +16,9 @@ let btn = Vue.component("airBtn", airBtn); //全局注册
document.body.appendChild(new btn().$mount().$el); document.body.appendChild(new btn().$mount().$el);
// #endif // #endif
// 引入uView对小程序分享的mixin封装
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
Vue.mixin(mpShare)
/** /**
* 全局filters * 全局filters

View File

@ -65,8 +65,14 @@ export default {
* 清除缓存重新登录 * 清除缓存重新登录
*/ */
async confirm() { async confirm() {
try{
await logout(); await logout();
this.clear(); this.clear();
}catch(e){
//TODO handle the exception
this.clear();
}
}, },
/** /**

View File

@ -125,6 +125,7 @@
<div class="sale" v-if="current === 0 && sku.afterSaleStatus"> <div class="sale" v-if="current === 0 && sku.afterSaleStatus">
<div <div
v-if=" v-if="
order.flowPrice != 0 &&
sku.afterSaleStatus.includes('NOT_APPLIED') || sku.afterSaleStatus.includes('NOT_APPLIED') ||
sku.afterSaleStatus.includes('PART_AFTER_SALE') sku.afterSaleStatus.includes('PART_AFTER_SALE')
" "

View File

@ -335,12 +335,6 @@ export default {
type: "error", type: "error",
}); });
return false; return false;
} else if (checkBankno(this.form.bankAccountNumber) === false) {
this.$refs.uToast.show({
title: "银行卡卡号不正确",
type: "error",
});
return false;
} else if (this.$u.test.chinese(this.form.bankAccountName) === false) { } else if (this.$u.test.chinese(this.form.bankAccountName) === false) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: "银行开户名输入错误", title: "银行开户名输入错误",

View File

@ -605,15 +605,7 @@ export default {
this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId); this.init(this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId);
} }
}, },
// #ifdef MP-WEIXIN
onShareAppMessage(res) {
return {
path: this.share(),
title: `[好友推荐]${this.goodsDetail.goodsName}`,
imageUrl: this.goodsDetail.goodsGalleryList[0],
};
},
// #endif
methods: { methods: {
share() { share() {
return `/pages/product/goods?id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`; return `/pages/product/goods?id=${this.routerVal.id}&goodsId=${this.routerVal.goodsId}`;

View File

@ -1,8 +1,9 @@
/** 配置楼层模块的跳转 */ /** 配置楼层模块的跳转 */
export function modelNavigateTo(item) { export function modelNavigateTo(item) {
let val = item.url; let val = item.url || item;
console.log(item);
switch (val.___type) { // return;
switch (val.___type || item.type) {
case "goods": case "goods":
uni.navigateTo({ uni.navigateTo({
url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId, url: "/pages/product/goods?id=" + val.id + "&goodsId=" + val.goodsId,
@ -36,7 +37,7 @@ export function modelNavigateTo(item) {
}); });
break; break;
case "other": case "other":
switch (val.title) { switch (val.title || item.title) {
case "首页": case "首页":
uni.switchTab({ uni.switchTab({
url: `/pages/tabbar/home/index`, url: `/pages/tabbar/home/index`,
@ -102,12 +103,12 @@ export function modelNavigateTo(item) {
url: `/pages/product/shopList`, url: `/pages/product/shopList`,
}); });
break; break;
case "外部链接": default:
// #ifdef H5 // #ifdef H5
window.location.href = val.url; window.location.href = val.url || item.link;
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.runtime.openURL(val.url) //不需要拼接\ plus.runtime.openURL(val.url || item.link) //不需要拼接\
// #endif // #endif
break; break;
} }

View File

@ -1,15 +1,20 @@
<template> <template>
<div class="layout"> <div class="layout">
<div class="flex-one" @click="modelNavigateTo(res.list[0])"> <div class="flex-one">
<u-image width="100%" mode="aspectFit" height="280rpx" :src="res.list[0].img" alt=""></u-image> <!-- <u-image width="100%" mode="aspectFit" height="280rpx" :src="res.list[0].img" alt=""></u-image> -->
<hotzone :res="res"></hotzone>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { modelNavigateTo } from "./tpl"; import { modelNavigateTo } from "./tpl";
import hotzone from "@/pages/tabbar/home/template/tpl_hot_zone.vue";
export default { export default {
title: "单行图片模块", title: "单行图片模块",
components: {
hotzone,
},
data() { data() {
return { return {
modelNavigateTo, modelNavigateTo,

View File

@ -0,0 +1,57 @@
<template>
<div class="layout">
<div class="flex-one hot-image">
<image mode="widthFix" :src="res.list[0].img" alt=""></image>
<image
v-for="(area, index) in res.list[0].zoneInfo"
:key="index"
@click="modelNavigateTo(area)"
mode="widthFix"
class="hot-area"
:style="{
left: area.leftPer * 100 + '%',
top: area.topPer * 100 + '%',
width: area.widthPer * 100 + '%',
height: area.heightPer * 100 + '%',
}"
:src="area.img"
alt=""
></image>
</div>
</div>
</template>
<script>
import { modelNavigateTo } from "./tpl";
export default {
title: "热区模块",
data() {
return {
modelNavigateTo,
};
},
props: ["res"],
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.hot-image {
position: relative;
}
.hot-area {
position: absolute;
z-index: 99;
}
.flex-one {
width: 100%;
display: block;
overflow: hidden;
image {
width: 100%;
min-height: 200rpx;
// height: 100%;
}
}
</style>

View File

@ -39,8 +39,10 @@
:key="_index" :key="_index"
> >
<div class="item-img-box"> <div class="item-img-box">
<img <u-image
class="item-img" class="item-img"
width="156rpx"
height="156rpx"
:src="i.thumbnail ? i.thumbnail : i.goodsImage" :src="i.thumbnail ? i.thumbnail : i.goodsImage"
alt alt
/> />

View File

@ -50,7 +50,7 @@
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> --> <!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> --> <!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
</div> </div>
<u-no-network @retry='init' @isConnected='isConnected'></u-no-network> <u-no-network @retry="init" @isConnected="isConnected"></u-no-network>
</div> </div>
</template> </template>
@ -125,6 +125,7 @@ export default {
getFloorData().then((res) => { getFloorData().then((res) => {
if (res.data.success) { if (res.data.success) {
this.pageData = JSON.parse(res.data.result.pageData); this.pageData = JSON.parse(res.data.result.pageData);
console.log(this.pageData);
} }
}); });
}, },

View File

@ -854,7 +854,7 @@ function downloadPopup(data, callback, cancelCallback, rebootCallback) {
export default function (isPrompt = false) { export default function (isPrompt = false) {
getCurrentNo((version) => { getCurrentNo((version) => {
getServerNo((res) => { getServerNo((res) => {
if (res.versionCode.replace(/\./g, "") <= version.version) { if (res.versionCode.replace(/\./g, "") <= version.version.replace(/\./g, "") ) {
return false; return false;
} }

View File

@ -121,6 +121,7 @@ http.interceptors.response.use(
if (!isRefreshing) { if (!isRefreshing) {
console.log('旧token',token) console.log('旧token',token)
isRefreshing = true; isRefreshing = true;
storage.setAccessToken('')
let oldRefreshToken = storage.getRefreshToken(); let oldRefreshToken = storage.getRefreshToken();
//调用刷新token的接口 //调用刷新token的接口
return refreshTokenFn(oldRefreshToken) return refreshTokenFn(oldRefreshToken)