Commit a84470b5 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/mallapp into master

# Conflicts:
#	pages/index/index.vue
parents d92f40e5 696d32dc
......@@ -59,7 +59,7 @@ export default {
loading: false,
coupon_id:0,
isreceive:false,
type:0
type:0,//type 1是优惠券列表来的 2 是领券中心来的
};
},
......@@ -113,14 +113,18 @@ export default {
);
},
gouseUrl(g){
let id
if(this.type == 1){
id = g.ID
}else if(this.type == 2){
id = g.CouponId
let data = []
if(g.UseType==1 || g.UseType==2){
g.ProductList.forEach(x=>{
data.push(x.ProductId)
})
let id = data.toString()
uni.redirectTo({ url: '/pages/goods/list?coupon_id='+ id+'&UseType='+g.UseType });
}else{
uni.redirectTo({ url: '/pages/goods/list'});
}
uni.redirectTo({ url: '/pages/goods/list?coupon_id='+ id});
}
},
......
......@@ -84,7 +84,7 @@ export default {
let t = getCurrentPages();
let u = uni.getStorageSync("mall_UserInfo");
let uid = u.UserId ? u.UserId : 0;
this.path = '/' + t[t.length - 1].route+"?id=" + this.goodId + "&user_id=" + uid;
this.path = '/pages/index/index?id=' + this.goodId + "&user_id=" + uid+'&JumpType=1';
//console.log(t[t.length - 1]);
this.favorStatus = this.favorite;
......
......@@ -302,7 +302,8 @@ export default {
url: "/api/Mall/GetGoosPoster",
data: {
goodsId: this.id,
path: "/pages/goods/goods?id=" + this.id + "&user_id=" + u.UserId,
// path: "/pages/goods/goods?id=" + this.id + "&user_id=" + u.UserId,
path: "/pages/index/index?id=" + this.id + "&user_id=" + u.UserId+'&JumpType=1',
},
},
(res) => {
......
......@@ -447,7 +447,8 @@ export default {
this.g.app_share_title != null && this.g.app_share_title != ""
? this.g.app_share_title
: this.g.name,
path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid+ "&SmallShopId=" + SmallShopId,
// path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid+ "&SmallShopId=" + SmallShopId,
path: "/pages/index/index?id=" + this.id + "&user_id=" + uid+ "&SmallShopId=" + SmallShopId+'&JumpType=1',
imageUrl:
this.g.app_share_pic != null && this.g.app_share_pic != ""
? this.g.app_share_pic
......
......@@ -93,8 +93,15 @@
onLoad(option) {
this.mainColor = this.$uiConfig.mainColor;
this.catId = option.cat_id;
if (option.coupon_id != undefined) {
this.coupon_id = option.coupon_id //优惠券带过来的参数
if (option && option.coupon_id && option.UseType) {//优惠券带过来的参数
console.log(option.coupon_id)
if(option.UseType==1){
this.msg.CategoryIds = option.coupon_id
}else if(option.UseType==2){
this.msg.GoodsIds = option.coupon_id
}
}
if (option.CategoryIds) {
this.msg.CategoryIds = option.CategoryIds;
......
......@@ -129,6 +129,8 @@ export default {
showAuth: false,
U: {},
shopData: {},
JumpType: 0,
GoodsId: 29,
};
},
components: {
......@@ -217,7 +219,16 @@ export default {
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"],
});
if (options && options.JumpType) {
//跳转类型 1为详情2为直播列表
this.JumpType = options.JumpType;
}
if (options && options.id) {
//商品详情
this.GoodsId = options.id;
} else {
this.GoodsId = options.GoodsId ? options.GoodsId : 29;
}
that.u = uni.getStorageSync("mall_UserInfo");
wx.getUserInfo({
success: function (res) {
......@@ -229,6 +240,18 @@ export default {
Photo: res.userInfo.avatarUrl,
};
that.updateuserinfo(msg);
// 如果登录的情况下直接跳转商品详情或者直播列表
setTimeout(() => {
if (that.JumpType == 1) {
//商品详情
uni.navigateTo({
url: "/pages/goods/goods?GoodsId=" + that.GoodsId,
});
} else if (that.JumpType == 2) {
//直播列表
uni.navigateTo({ url: "/pages/live/index" });
}
}, 500);
} else {
//静默登录操作
uni.login({
......@@ -306,8 +329,14 @@ export default {
: 0;
}
console.log(uid);
let title=this.setting.share_title
? this.setting.share_title
: uni.getStorageSync("basedata").mall.name
if(SmallShopId!=0){
title=this.shopData.Name
}
return {
title: "",
title: title,
query: "user_id=" + uid + "&SmallShopId=" + SmallShopId,
imageUrl: "",
};
......@@ -332,25 +361,19 @@ export default {
? uni.getStorageSync("mall_UserInfo").UserSmallShopId
: 0;
}
if (SmallShopId != 0) {
return {
title: this.shopData.Name
? this.shopData.Name
: uni.getStorageSync("basedata").mall.name,
path:
"/pages/index/index?user_id=" + uid + "&SmallShopId=" + SmallShopId,
imageUrl: "",
};
} else {
return {
title: this.setting.share_title
let title=this.setting.share_title
? this.setting.share_title
: uni.getStorageSync("basedata").mall.name,
path:
"/pages/index/index?user_id=" + uid + "&SmallShopId=" + SmallShopId,
imageUrl: this.setting.share_pic ? this.setting.share_pic : "",
};
: uni.getStorageSync("basedata").mall.name
if(SmallShopId!=0){
title=this.shopData.Name
}
return {
title: title,
path:
"/pages/index/index?user_id=" + uid + "&SmallShopId=" + SmallShopId,
imageUrl: "",
};
},
// #endif
onShow() {
......@@ -410,6 +433,19 @@ export default {
that.u = res.data;
uni.removeStorageSync("pid");
uni.removeStorageSync("SmallShopId");
// 如果登录的情况下直接跳转商品详情或者直播列表
setTimeout(() => {
if (that.JumpType == 1) {
//商品详情
uni.navigateTo({
url: "/pages/goods/goods?GoodsId=" + that.GoodsId,
});
} else if (that.JumpType == 2) {
//直播列表
uni.navigateTo({ url: "/pages/live/index" });
}
}, 500);
} else {
if (!that.u) {
that.u = {
......@@ -699,6 +735,16 @@ export default {
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.$refs.son[0].getSmallShopById(2); //第一次登陆成功后去调取微店的信息
// 如果登录的情况下直接跳转商品详情或者直播列表
setTimeout(() => {
if (that.JumpType == 1) {
//商品详情
uni.navigateTo({ url: "/pages/goods/goods?GoodsId=" + that.GoodsId });
} else if (that.JumpType == 2) {
//直播列表
uni.navigateTo({ url: "/pages/live/index" });
}
}, 500);
},
//关闭登录窗口
gbAuth() {
......
......@@ -23,7 +23,9 @@
<u-row gutter="20">
<u-col span="6" v-for="(cx, ci) in g" :key="ci">
<view class="good" @click="clickHandler(cx)">
<view class="sharebox" v-if="cx.ExtensionImg&&cx.ExtensionImg!=''" @click.native.stop="goshare(cx.ExtensionImg)">
<!-- <view class="sharebox" v-if="cx.ExtensionImg&&cx.ExtensionImg!=''" @click.native.stop="goshare(cx.ExtensionImg)"> -->
<view class="sharebox" v-if="cx.ExtensionImg&&cx.ExtensionImg!=''" @click.native.stop="goshare(cx.ExtensionImg,
cx.LiveQrCodePaddingTop,cx.LiveQrCodePaddingLeft,cx.LiveQrCodeSize,cx.LiveQrCodeType)">
<image src="../../static/images/share.png" mode="widthFix" class="share" />
</view>
<!-- <view class="good-img" :style="{ 'background-image': 'url(' + (cx.cover_img ? cx.cover_img : '') + ')', backgroundSize: '100% 100%' }"> -->
......@@ -145,7 +147,6 @@ export default {
};
},
onLoad(option) {
console.log(option,'option')
this.mc = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
let c = this.$uiConfig.is_bang ? 80 : 52;
......@@ -170,9 +171,8 @@ export default {
}
},
methods: {
goshare(img){
console.log(img)
uni.navigateTo({url: '/pages/live/share?pic='+img});
goshare(img,top,left,size,type){
uni.navigateTo({url: '/pages/live/share?pic='+img+'&top='+top+'&left='+left+'&size='+size+'&type='+type});
},
initPage() {
let currentPages = getCurrentPages();
......
......@@ -26,7 +26,8 @@ export default {
qrCodeSize:126, //二维码宽高
qrCodeLeft:595, //二维码左边距
qrCodeTop:1200 ,//二维码上边距
halfCode:63 //二维码一半高度
halfCode:63 ,//二维码一半高度
type:0, //二维码形状(0-圆形,1-方形)
};
},
created() {
......@@ -36,25 +37,24 @@ export default {
this.UserInfo = uni.getStorageSync("mall_UserInfo")
? uni.getStorageSync("mall_UserInfo")
: {};
this.qrCodeConfig = uni.getStorageSync('basedata') ? uni.getStorageSync('basedata').liveConfig : {};
if(this.qrCodeConfig){
if(this.qrCodeConfig.LiveQrCodePaddingLeft){
this.qrCodeLeft=this.qrCodeConfig.LiveQrCodePaddingLeft;
}
if(this.qrCodeConfig.LiveQrCodePaddingTop){
this.qrCodeTop=this.qrCodeConfig.LiveQrCodePaddingTop;
}
if(this.qrCodeConfig.LiveQrCodeSize){
this.qrCodeSize=this.qrCodeConfig.LiveQrCodeSize;
this.halfCode=parseInt(this.qrCodeConfig.LiveQrCodeSize/2);
}
}
},
onLoad(option) {
this.bgPic =
option.pic ??
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1597312414000_253.jpg";
if(option.left){
this.qrCodeLeft=parseInt(option.left);
}
if(option.top){
this.qrCodeTop=parseInt(option.top);
}
if(option.size){
this.qrCodeSize=parseInt(option.size);
this.halfCode=parseInt(option.size/2);
}
if(option.type){
this.type=parseInt(option.type);
}
},
onReady() {
this.init();
......@@ -66,24 +66,11 @@ export default {
},
methods: {
init() {
// uni.showNavigationBarLoading();
// this.request2(
// {
// url: "/api/AppletUser/GetFenXiaoPoster",
// data: {},
// },
// (res) => {
// uni.hideNavigationBarLoading();
// this.qrcode = res.data;
// this.getWeiXinQRCode();
// }
// );
this.getWeiXinQRCode();
},
getWeiXinQRCode() {
let that = this;
uni.showNavigationBarLoading();
console.log(that.UserInfo,'that.UserInfo')
let SmallShopId = that.UserInfo.SmallShopId?that.UserInfo.SmallShopId:0;
if(SmallShopId==0){
SmallShopId = that.UserInfo.UserSmallShopId?that.UserInfo.UserSmallShopId:0;
......@@ -92,14 +79,14 @@ export default {
{
url: "/api/AppletUser/GetWeiXinQRCodeForApplet",
data: {
Path: "pages/live/index?user_id=" + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId,
// Path: "pages/live/index?user_id=" + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId,
Path: "/pages/index/index?user_id=" + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId+'&JumpType=2',
With: that.qrcode.QrCodeSize,
},
},
(res) => {
uni.hideNavigationBarLoading();
that.fenxqrcode = that.host2 + res.data;
console.log(that.fenxqrcode);
let tmpTimeout = setTimeout(() => {
that.drawCtx();
clearTimeout(tmpTimeout);
......@@ -116,7 +103,6 @@ export default {
uni.getImageInfo({
src: that.bgPic,
success: function (image) {
console.log("绘制");
ctx.drawImage(image.path, 0, 0, 750, 1344); //绘制图
uni.getImageInfo({
//头像
......@@ -124,11 +110,13 @@ export default {
success: function (image) {
ctx.save();
ctx.beginPath();
// ctx.arc(595 + 63, 1200 + 63, 63, 0, Math.PI * 2);
ctx.arc(that.qrCodeLeft + that.halfCode, that.qrCodeTop + that.halfCode, that.halfCode, 0, Math.PI * 2);
if(that.type==0){
ctx.arc(that.qrCodeLeft + that.halfCode, that.qrCodeTop + that.halfCode, that.halfCode, 0, Math.PI * 2);
ctx.clip();
}
ctx.setFillStyle("#ffffff");
ctx.fill();
ctx.clip();
// ctx.drawImage(image.path, 595, 1200, 126, 126); //绘制头像
ctx.drawImage(image.path, that.qrCodeLeft, that.qrCodeTop, that.qrCodeSize, that.qrCodeSize); //绘制头像
that.drawQrCode(ctx);
......@@ -213,7 +201,6 @@ export default {
},
drawQrCode(ctx) {
let that = this;
console.log("生成海报12");
setTimeout(() => {
ctx.draw(false, () => {
uni.canvasToTempFilePath(
......@@ -228,7 +215,6 @@ export default {
success: (res) => {
uni.hideLoading();
that.tempPic = res.tempFilePath;
console.log(res,'res');
},
fail(e) {
console.log(e);
......@@ -265,7 +251,6 @@ export default {
uni.authorize({
scope: "scope.writePhotosAlbum",
success: (res) => {
console.log("11111");
},
fail: (res) => {
uni.showModal({
......@@ -277,7 +262,6 @@ export default {
if (res.confirm) {
uni.openSetting({
success: (res) => {
console.log(res);
if (res.authSetting["scope.writePhotosAlbum"]) {
that.preservation();
}
......
......@@ -95,7 +95,7 @@
<button
open-type="contact"
:send-message-title="d.OrderInfo.GoodsName"
:send-message-path="'/pages/goods/goods?id=' + d.OrderInfo.GoodsId + '&user_id=' + uid"
:send-message-path="'/pages/index/index?id=' + d.OrderInfo.GoodsId + '&user_id=' + uid+'&JumpType=1'"
:send-message-img="d.OrderInfo.CoverImagePath"
:show-message-card="true"
>
......
......@@ -150,7 +150,7 @@
<button
open-type="contact"
:send-message-title="x.GoodsName"
:send-message-path="'/pages/goods/goods?id=' + x.GoodsId + '&user_id=' + uid"
:send-message-path="'/pages/index/index?id=' + x.GoodsId + '&user_id=' + uid+'&JumpType=1'"
:send-message-img=" x.CoverImagePath "
:show-message-card="true"
>
......
......@@ -411,7 +411,8 @@ export default {
this.g.app_share_title != null && this.g.app_share_title != ""
? this.g.app_share_title
: this.g.name,
path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid,
// path: "/pages/goods/goods?id=" + this.id + "&user_id=" + uid,
path: "/pages/index/index?id=" + this.id + "&user_id=" + uid+'&JumpType=1',
imageUrl:
this.g.app_share_pic != null && this.g.app_share_pic != ""
? this.g.app_share_pic
......
......@@ -70,7 +70,7 @@
{
url: '/api/AppletUser/GetWeiXinQRCodeForApplet',
data: {
Path:'pages/index/index?user_id=' + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId,
Path:'/pages/index/index?user_id=' + that.UserInfo.UserId+'&SmallShopId='+ SmallShopId,
With:that.qrcode.QrCodeSize,
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment