Merge branch 'master' of gitee.com:beijing_hongye_huicheng/lilishop-uniapp

master
paulGao 2021-12-21 19:12:20 +08:00
commit 07627c41e3
2 changed files with 92 additions and 59 deletions

View File

@ -1,26 +1,32 @@
/** /**
* 公共API * 公共API
*/ */
import {http, Method} from '@/utils/request.js'; import { http, Method } from "@/utils/request.js";
import api from '@/config/api.js'; import api from "@/config/api.js";
/**
* 获取地区数据
/** * @param id
* 获取地区数据 */
* @param id export function getRegionsById(id = 0) {
*/ return http.request({
export function getRegionsById(id = 0) { url: `${api.common}/region/item/${id}`,
return http.request({ method: Method.GET,
url: `${api.common}/region/item/${id}`, message: false,
method: Method.GET, });
message: false, }
});
} // 获取IM接口前缀
export function getIMDetail() {
/** return http.request({
* 文件上传地址 url: `${api.common}/IM`,
* @type {string} method: Method.GET,
*/ message: false,
export const upload =api.common+'/upload/file'; });
}
/**
* 文件上传地址
* @type {string}
*/
export const upload = api.common + "/upload/file";

View File

@ -221,7 +221,7 @@
</view> </view>
</view> </view>
<view class="card-flex" @click="shutMask(3)"> <view class="card-flex" @click="shutMask(3)">
<view class="card-title"> 送至 </view> <view class="card-title"> 送至</view>
<view class="card-content"> <view class="card-content">
<span v-if="delivery">{{ <span v-if="delivery">{{
delivery.consigneeAddressPath | clearStrComma delivery.consigneeAddressPath | clearStrComma
@ -362,6 +362,7 @@ import { getGoods, getGoodsList, getMpScene, getGoodsDistribution } from "@/api/
import * as API_trade from "@/api/trade.js"; import * as API_trade from "@/api/trade.js";
import * as API_Members from "@/api/members.js"; import * as API_Members from "@/api/members.js";
import * as API_store from "@/api/store.js"; import * as API_store from "@/api/store.js";
import { getIMDetail } from '@/api/common'
import { modelNavigateTo } from "@/pages/tabbar/home/template/tpl.js"; import { modelNavigateTo } from "@/pages/tabbar/home/template/tpl.js";
/************请求存储***************/ /************请求存储***************/
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
@ -522,9 +523,17 @@ export default {
startTimer: false, // false startTimer: false, // false
routerVal: "", routerVal: "",
IMLink:"", // IM
}; };
}, },
computed:{
IM() {
return this.IMLink + this.storeDetail.merchantEuid;
},
},
watch: { watch: {
isGroup(val) { isGroup(val) {
if (val) { if (val) {
@ -679,7 +688,7 @@ export default {
this.cartCount(); this.cartCount();
// //
this.getstoreRecommend(); this.getStoreRecommend();
// //
this.getOtherLikeGoods(); this.getOtherLikeGoods();
@ -688,37 +697,55 @@ export default {
if (this.$options.filters.isLogin("auth")) { if (this.$options.filters.isLogin("auth")) {
this.getGoodsCollectionFun(this.goodsDetail.id); this.getGoodsCollectionFun(this.goodsDetail.id);
} }
}, // IM 使
linkMsgDetail() { // this.getIMDetailMethods();
//
// #ifdef MP-WEIXIN
const params = { },
storeName: this.storeDetail.storeName,
goodsName: this.goodsDetail.goodsName, async getIMDetailMethods(){
goodsId: this.goodsDetail.goodsId, let res = await getIMDetail()
goodsImg: this.goodsDetail.thumbnail, if(res.data.success){
price: this.goodsDetail.promotionPrice || this.goodsDetail.price, this.IMLink = res.data.result
// originalPrice: this.goodsDetail.original || this.goodsDetail.price, }
uuid: storage.getUuid(), },
token: storage.getAccessToken(),
sign: this.storeDetail.yzfSign, linkMsgDetail() {
mpSign: this.storeDetail.yzfMpSign,
}; if(this.storeDetail.merchantEuid){
uni.navigateTo({ uni.navigateTo({
url: url:`/pages/tabbar/home/web-view?src=${this.IM}`
"/pages/product/customerservice/index?params=" + });
encodeURIComponent(JSON.stringify(params)), }
}); else{
// #endif //
// #ifndef MP-WEIXIN // #ifdef MP-WEIXIN
const sign = this.storeDetail.yzfSign; const params = {
uni.navigateTo({ storeName: this.storeDetail.storeName,
url: goodsName: this.goodsDetail.goodsName,
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" + goodsId: this.goodsDetail.goodsId,
sign, goodsImg: this.goodsDetail.thumbnail,
}); price: this.goodsDetail.promotionPrice || this.goodsDetail.price,
// #endif // originalPrice: this.goodsDetail.original || this.goodsDetail.price,
uuid: storage.getUuid(),
token: storage.getAccessToken(),
sign: this.storeDetail.yzfSign,
mpSign: this.storeDetail.yzfMpSign,
};
uni.navigateTo({
url:
"/pages/product/customerservice/index?params=" +
encodeURIComponent(JSON.stringify(params)),
});
// #endif
// #ifndef MP-WEIXIN
const sign = this.storeDetail.yzfSign;
uni.navigateTo({
url:
"/pages/tabbar/home/web-view?src=https://yzf.qq.com/xv/web/static/chat/index.html?sign=" +
sign,
});
// #endif
}
}, },
// 1999 --> [1999,00] // 1999 --> [1999,00]
formatPrice(val) { formatPrice(val) {
@ -834,7 +861,7 @@ export default {
/** /**
* 获取店铺推荐商品列表 * 获取店铺推荐商品列表
*/ */
getstoreRecommend() { getStoreRecommend() {
getGoodsList({ getGoodsList({
pageNumber: 1, pageNumber: 1,
pageSize: 6, pageSize: 6,