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