兼容app,修改海报生成的问题
This commit is contained in:
@ -72,6 +72,14 @@ export function getGroomList(type) {
|
|||||||
login: true
|
login: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* 获取商品海报
|
||||||
|
* */
|
||||||
|
export function getProductPoster(id) {
|
||||||
|
return request.get("/product/poster/" + id, {}, {
|
||||||
|
login: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 购物车 添加
|
* 购物车 添加
|
||||||
|
@ -47,6 +47,80 @@
|
|||||||
<view class="mask"></view>
|
<view class="mask"></view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import html2canvas from "html2canvas";
|
||||||
|
import { PosterCanvas } from "@/utils";
|
||||||
|
import { getProductPoster } from "@/api/store";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "StorePoster",
|
||||||
|
props: {
|
||||||
|
posterImageStatus: Boolean,
|
||||||
|
posterData: Object,
|
||||||
|
goodId: String
|
||||||
|
},
|
||||||
|
data: function() {
|
||||||
|
return {
|
||||||
|
canvasStatus: false,
|
||||||
|
posterImage: ""
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
posterImageStatus: function() {
|
||||||
|
var that = this;
|
||||||
|
if (that.posterImageStatus === true) {
|
||||||
|
that.$nextTick(function() {
|
||||||
|
that.savePosterPath();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted: function() {},
|
||||||
|
methods: {
|
||||||
|
posterImageClose: function() {
|
||||||
|
this.posterImageStatus = false;
|
||||||
|
this.canvasStatus = false;
|
||||||
|
this.$emit("setPosterImageStatus");
|
||||||
|
},
|
||||||
|
savePosterPath: function() {
|
||||||
|
const that = this;
|
||||||
|
|
||||||
|
uni.showLoading({ title: "海报生成中", mask: true });
|
||||||
|
getProductPoster(this.goodId)
|
||||||
|
.then(res => {
|
||||||
|
this.canvasStatus = true;
|
||||||
|
this.posterImage = res.data;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
});
|
||||||
|
// return;
|
||||||
|
// //清空图片重新生成
|
||||||
|
// that.posterImage = "";
|
||||||
|
// uni.showLoading({ title: "海报生成中", mask: true });
|
||||||
|
// console.log(this);
|
||||||
|
// var prodId = that.$yrouter.currentRoute.query.id;
|
||||||
|
// uni.downloadFile({
|
||||||
|
// url:
|
||||||
|
// this.$VUE_APP_API_URL +
|
||||||
|
// "/shareImg/" +
|
||||||
|
// prodId +
|
||||||
|
// "?shareImgName=" +
|
||||||
|
// this.posterData.code,
|
||||||
|
// fail: function(res) {},
|
||||||
|
// success: function(res) {
|
||||||
|
// console.log(res);
|
||||||
|
// that.canvasStatus = true;
|
||||||
|
// that.posterImage = res.tempFilePath;
|
||||||
|
// uni.hideLoading();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less" lang="less">
|
<style scoped lang="less" lang="less">
|
||||||
.poster-first {
|
.poster-first {
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
@ -135,45 +209,3 @@
|
|||||||
z-index: 9;
|
z-index: 9;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
|
||||||
// import html2canvas from "html2canvas";
|
|
||||||
import { PosterCanvas } from "@/utils";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "StorePoster",
|
|
||||||
props: {
|
|
||||||
posterImageStatus: Boolean,
|
|
||||||
posterData: Object
|
|
||||||
},
|
|
||||||
data: function() {
|
|
||||||
return {
|
|
||||||
canvasStatus: false,
|
|
||||||
posterImage: ""
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
posterImageStatus: function() {
|
|
||||||
var that = this;
|
|
||||||
if (that.posterImageStatus === true) {
|
|
||||||
that.$nextTick(function() {
|
|
||||||
that.savePosterPath();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted: function() {},
|
|
||||||
methods: {
|
|
||||||
posterImageClose: function() {
|
|
||||||
this.posterImageStatus = false;
|
|
||||||
this.canvasStatus = false;
|
|
||||||
this.$emit("setPosterImageStatus");
|
|
||||||
},
|
|
||||||
savePosterPath: function() {
|
|
||||||
PosterCanvas(this.posterData, posterImage => {
|
|
||||||
this.canvasStatus = true;
|
|
||||||
this.posterImage = posterImage;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
@ -145,7 +145,7 @@ export default {
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
|
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
|
||||||
export const VUE_APP_API_URL = 'https://h5api.dayouqiantu.cn/api';
|
export const VUE_APP_API_URL = 'https://h5api.dayouqiantu.cn/api';
|
||||||
export const VUE_APP_RESOURCES_URL = 'https://h5.dayouqiantu.cn/static';
|
export const VUE_APP_RESOURCES_URL = 'https://h5.dayouqiantu.cn/static';
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"compilerVersion" : 3,
|
"compilerVersion" : 3,
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender" : true,
|
"alwaysShowBeforeRender" : true,
|
||||||
"waiting" : true,
|
"waiting" : false,
|
||||||
"autoclose" : true,
|
"autoclose" : true,
|
||||||
"delay" : 0
|
"delay" : 0
|
||||||
},
|
},
|
||||||
|
@ -279,7 +279,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -338,7 +338,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -155,7 +155,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -214,7 +214,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -5,19 +5,25 @@
|
|||||||
<text class="iconfont icon-xiazai5"></text>
|
<text class="iconfont icon-xiazai5"></text>
|
||||||
搜索商品
|
搜索商品
|
||||||
</view>
|
</view>
|
||||||
<view class="qr" @click="startQr()"><image src="@/static/images/qr.png" /></view>
|
<view class="qr" @click="startQr()">
|
||||||
|
<image src="@/static/images/qr.png" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="slider-banner banner">
|
<view class="slider-banner banner">
|
||||||
<swiper indicatorDots="true" v-if="banner.length > 0">
|
<swiper indicatorDots="true" v-if="banner.length > 0">
|
||||||
<block v-for="(item, bannerIndex) in banner" :key="bannerIndex">
|
<block v-for="(item, bannerIndex) in banner" :key="bannerIndex">
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<view @click="item.url ? $yrouter.push('/' + item.url) : ''" class="swiper-item"><image :src="item.pic" /></view>
|
<view @click="item.url ? $yrouter.push('/' + item.url) : ''" class="swiper-item">
|
||||||
|
<image :src="item.pic" />
|
||||||
|
</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</block>
|
</block>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
<view class="news acea-row row-between-wrapper">
|
<view class="news acea-row row-between-wrapper">
|
||||||
<view class="pictrue" v-if="$VUE_APP_RESOURCES_URL"><image src="@/static/images/news.png" /></view>
|
<view class="pictrue" v-if="$VUE_APP_RESOURCES_URL">
|
||||||
|
<image src="@/static/images/news.png" />
|
||||||
|
</view>
|
||||||
<view class="swiper-no-swiping new-banner">
|
<view class="swiper-no-swiping new-banner">
|
||||||
<swiper class="swiper-wrapper" v-if="roll.length > 0" :indicator-dots="false" autoplay circular vertical>
|
<swiper class="swiper-wrapper" v-if="roll.length > 0" :indicator-dots="false" autoplay circular vertical>
|
||||||
<block v-for="(item, rollIndex) in roll" :key="rollIndex">
|
<block v-for="(item, rollIndex) in roll" :key="rollIndex">
|
||||||
@ -36,14 +42,18 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="nav acea-row">
|
<view class="nav acea-row">
|
||||||
<view @click="goWxappUrl(item)" class="item" v-for="(item, menusIndex) in menus" :key="menusIndex">
|
<view @click="goWxappUrl(item)" class="item" v-for="(item, menusIndex) in menus" :key="menusIndex">
|
||||||
<view class="pictrue"><image :src="item.pic" /></view>
|
<view class="pictrue">
|
||||||
|
<image :src="item.pic" />
|
||||||
|
</view>
|
||||||
<view>{{ item.name }}</view>
|
<view>{{ item.name }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper hot" v-if="bastList.length > 0">
|
<view class="wrapper hot" v-if="bastList.length > 0">
|
||||||
<image class="bg" src="../../static/images/index-bg.png" mode="widthFix"></image>
|
<image class="bg" src="../../static/images/index-bg.png" mode="widthFix"></image>
|
||||||
<view class="title acea-row row-between-wrapper">
|
<view class="title acea-row row-between-wrapper">
|
||||||
<view class="text"><view class="name line1">热门榜单</view></view>
|
<view class="text">
|
||||||
|
<view class="name line1">热门榜单</view>
|
||||||
|
</view>
|
||||||
<view @click="goHotNewGoods(2)" class="more">
|
<view @click="goHotNewGoods(2)" class="more">
|
||||||
更多
|
更多
|
||||||
<text class="iconfont icon-jiantou"></text>
|
<text class="iconfont icon-jiantou"></text>
|
||||||
@ -53,7 +63,9 @@
|
|||||||
<scroll-view scroll-y="false" scroll-x="true">
|
<scroll-view scroll-y="false" scroll-x="true">
|
||||||
<view class="newProductsScroll">
|
<view class="newProductsScroll">
|
||||||
<view @click="goGoodsCon(item)" class="newProductsItem" v-for="(item, likeInfoIndex) in likeInfo" :key="likeInfoIndex">
|
<view @click="goGoodsCon(item)" class="newProductsItem" v-for="(item, likeInfoIndex) in likeInfo" :key="likeInfoIndex">
|
||||||
<view class="img-box"><image :src="item.image" /></view>
|
<view class="img-box">
|
||||||
|
<image :src="item.image" />
|
||||||
|
</view>
|
||||||
<view class="pro-info line1"><text>{{ item.storeName }}</text></view>
|
<view class="pro-info line1"><text>{{ item.storeName }}</text></view>
|
||||||
<view class="money font-color-red"><text>¥{{ item.price }}</text></view>
|
<view class="money font-color-red"><text>¥{{ item.price }}</text></view>
|
||||||
</view>
|
</view>
|
||||||
@ -63,7 +75,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="wrapper" v-if="bastList.length > 0">
|
<view class="wrapper" v-if="bastList.length > 0">
|
||||||
<view class="title acea-row row-between-wrapper">
|
<view class="title acea-row row-between-wrapper">
|
||||||
<view class="text"><view class="name line1">精品推荐</view></view>
|
<view class="text">
|
||||||
|
<view class="name line1">精品推荐</view>
|
||||||
|
</view>
|
||||||
<view @click="goHotNewGoods(1)" class="more">
|
<view @click="goHotNewGoods(1)" class="more">
|
||||||
更多
|
更多
|
||||||
<text class="iconfont icon-jiantou"></text>
|
<text class="iconfont icon-jiantou"></text>
|
||||||
@ -89,7 +103,9 @@
|
|||||||
<scroll-view scroll-y="false" scroll-x="true">
|
<scroll-view scroll-y="false" scroll-x="true">
|
||||||
<view class="newProductsScroll">
|
<view class="newProductsScroll">
|
||||||
<view @click="goGoodsCon(item)" class="newProductsItem" v-for="(item, firstListIndex) in firstList" :key="firstListIndex">
|
<view @click="goGoodsCon(item)" class="newProductsItem" v-for="(item, firstListIndex) in firstList" :key="firstListIndex">
|
||||||
<view class="img-box"><image :src="item.image" /></view>
|
<view class="img-box">
|
||||||
|
<image :src="item.image" />
|
||||||
|
</view>
|
||||||
<view class="pro-info line1">{{ item.storeName }}</view>
|
<view class="pro-info line1">{{ item.storeName }}</view>
|
||||||
<view class="money font-color-red">¥{{ item.price }}</view>
|
<view class="money font-color-red">¥{{ item.price }}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -99,7 +115,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="wrapper" v-if="benefit.length > 0">
|
<view class="wrapper" v-if="benefit.length > 0">
|
||||||
<view class="title acea-row row-between-wrapper">
|
<view class="title acea-row row-between-wrapper">
|
||||||
<view class="text"><view class="name line1">促销单品</view></view>
|
<view class="text">
|
||||||
|
<view class="name line1">促销单品</view>
|
||||||
|
</view>
|
||||||
<view @click="goGoodsPromotion(4)" class="more">
|
<view @click="goGoodsPromotion(4)" class="more">
|
||||||
更多
|
更多
|
||||||
<text class="iconfont icon-jiantou"></text>
|
<text class="iconfont icon-jiantou"></text>
|
||||||
@ -111,166 +129,209 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
// import { swiper, swiperSlide } from "vue-awesome-swiper";
|
||||||
|
|
||||||
import GoodList from '@/components/GoodList';
|
import GoodList from '@/components/GoodList';
|
||||||
import PromotionGood from '@/components/PromotionGood';
|
import PromotionGood from '@/components/PromotionGood';
|
||||||
import CouponWindow from '@/components/CouponWindow';
|
import CouponWindow from '@/components/CouponWindow';
|
||||||
import { getHomeData, getShare } from '@/api/public';
|
import {
|
||||||
import cookie from '@/utils/store/cookie';
|
getHomeData,
|
||||||
import { isWeixin } from '@/utils/index';
|
getShare
|
||||||
|
} from '@/api/public';
|
||||||
|
import cookie from '@/utils/store/cookie';
|
||||||
|
import {
|
||||||
|
isWeixin,
|
||||||
|
handleUrlParam
|
||||||
|
} from '@/utils/index';
|
||||||
|
|
||||||
const HAS_COUPON_WINDOW = 'has_coupon_window';
|
const HAS_COUPON_WINDOW = 'has_coupon_window';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Index',
|
name: 'Index',
|
||||||
components: {
|
components: {
|
||||||
// swiper,
|
// swiper,
|
||||||
// swiperSlide,
|
// swiperSlide,
|
||||||
GoodList,
|
GoodList,
|
||||||
PromotionGood,
|
PromotionGood,
|
||||||
CouponWindow
|
CouponWindow
|
||||||
},
|
|
||||||
props: {},
|
|
||||||
data: function() {
|
|
||||||
return {
|
|
||||||
showCoupon: false,
|
|
||||||
logoUrl: '',
|
|
||||||
banner: [],
|
|
||||||
menus: [],
|
|
||||||
roll: [],
|
|
||||||
activity: [],
|
|
||||||
activityOne: {},
|
|
||||||
bastList: [],
|
|
||||||
firstList: [],
|
|
||||||
info: {
|
|
||||||
fastList: [],
|
|
||||||
bastBanner: [],
|
|
||||||
|
|
||||||
bastList: []
|
|
||||||
},
|
|
||||||
likeInfo: [],
|
|
||||||
lovely: [],
|
|
||||||
benefit: [],
|
|
||||||
couponList: [],
|
|
||||||
swiperOption: {
|
|
||||||
pagination: {
|
|
||||||
el: '.swiper-pagination',
|
|
||||||
clickable: true
|
|
||||||
},
|
|
||||||
autoplay: {
|
|
||||||
disableOnInteraction: false,
|
|
||||||
delay: 2000
|
|
||||||
},
|
|
||||||
loop: true,
|
|
||||||
speed: 1000,
|
|
||||||
observer: true,
|
|
||||||
observeParents: true
|
|
||||||
},
|
|
||||||
swiperRoll: {
|
|
||||||
direction: 'vertical',
|
|
||||||
autoplay: {
|
|
||||||
disableOnInteraction: false,
|
|
||||||
delay: 2000
|
|
||||||
},
|
|
||||||
loop: true,
|
|
||||||
speed: 1000,
|
|
||||||
observer: true,
|
|
||||||
observeParents: true
|
|
||||||
},
|
|
||||||
swiperScroll: {
|
|
||||||
freeMode: true,
|
|
||||||
freeModeMomentum: false,
|
|
||||||
slidesPerView: 'auto',
|
|
||||||
observer: true,
|
|
||||||
observeParents: true
|
|
||||||
},
|
|
||||||
swiperBoutique: {
|
|
||||||
pagination: {
|
|
||||||
el: '.swiper-pagination',
|
|
||||||
clickable: true
|
|
||||||
},
|
|
||||||
autoplay: {
|
|
||||||
disableOnInteraction: false,
|
|
||||||
delay: 2000
|
|
||||||
},
|
|
||||||
loop: true,
|
|
||||||
speed: 1000,
|
|
||||||
observer: true,
|
|
||||||
observeParents: true
|
|
||||||
},
|
|
||||||
swiperProducts: {
|
|
||||||
freeMode: true,
|
|
||||||
freeModeMomentum: false,
|
|
||||||
slidesPerView: 'auto',
|
|
||||||
observer: true,
|
|
||||||
observeParents: true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onShow: function() {
|
|
||||||
let that = this;
|
|
||||||
uni.showLoading({
|
|
||||||
title: '加载中'
|
|
||||||
});
|
|
||||||
getHomeData().then(res => {
|
|
||||||
that.logoUrl = res.data.logoUrl;
|
|
||||||
that.$set(that, 'banner', res.data.banner);
|
|
||||||
that.$set(that, 'menus', res.data.menus);
|
|
||||||
that.$set(that, 'roll', res.data.roll);
|
|
||||||
that.$set(that, 'activity', res.data.activity);
|
|
||||||
var activityOne = res.data.activity.shift();
|
|
||||||
that.$set(that, 'activityOne', activityOne);
|
|
||||||
that.$set(that, 'info', res.data.info);
|
|
||||||
that.$set(that, 'firstList', res.data.firstList);
|
|
||||||
that.$set(that, 'bastList', res.data.bastList);
|
|
||||||
that.$set(that, 'likeInfo', res.data.likeInfo);
|
|
||||||
that.$set(that, 'lovely', res.data.lovely);
|
|
||||||
that.$set(that, 'benefit', res.data.benefit);
|
|
||||||
that.$set(that, 'couponList', res.data.couponList);
|
|
||||||
uni.hideLoading();
|
|
||||||
that.setOpenShare();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
goGoodSearch() {
|
|
||||||
this.$yrouter.push('/pages/shop/GoodSearch/index');
|
|
||||||
},
|
},
|
||||||
goWxappUrl(item) {
|
props: {},
|
||||||
this.$yrouter.push(item.uniapp_url);
|
data: function() {
|
||||||
|
return {
|
||||||
|
showCoupon: false,
|
||||||
|
logoUrl: '',
|
||||||
|
banner: [],
|
||||||
|
menus: [],
|
||||||
|
roll: [],
|
||||||
|
activity: [],
|
||||||
|
activityOne: {},
|
||||||
|
bastList: [],
|
||||||
|
firstList: [],
|
||||||
|
info: {
|
||||||
|
fastList: [],
|
||||||
|
bastBanner: [],
|
||||||
|
|
||||||
|
bastList: []
|
||||||
|
},
|
||||||
|
likeInfo: [],
|
||||||
|
lovely: [],
|
||||||
|
benefit: [],
|
||||||
|
couponList: [],
|
||||||
|
swiperOption: {
|
||||||
|
pagination: {
|
||||||
|
el: '.swiper-pagination',
|
||||||
|
clickable: true
|
||||||
|
},
|
||||||
|
autoplay: {
|
||||||
|
disableOnInteraction: false,
|
||||||
|
delay: 2000
|
||||||
|
},
|
||||||
|
loop: true,
|
||||||
|
speed: 1000,
|
||||||
|
observer: true,
|
||||||
|
observeParents: true
|
||||||
|
},
|
||||||
|
swiperRoll: {
|
||||||
|
direction: 'vertical',
|
||||||
|
autoplay: {
|
||||||
|
disableOnInteraction: false,
|
||||||
|
delay: 2000
|
||||||
|
},
|
||||||
|
loop: true,
|
||||||
|
speed: 1000,
|
||||||
|
observer: true,
|
||||||
|
observeParents: true
|
||||||
|
},
|
||||||
|
swiperScroll: {
|
||||||
|
freeMode: true,
|
||||||
|
freeModeMomentum: false,
|
||||||
|
slidesPerView: 'auto',
|
||||||
|
observer: true,
|
||||||
|
observeParents: true
|
||||||
|
},
|
||||||
|
swiperBoutique: {
|
||||||
|
pagination: {
|
||||||
|
el: '.swiper-pagination',
|
||||||
|
clickable: true
|
||||||
|
},
|
||||||
|
autoplay: {
|
||||||
|
disableOnInteraction: false,
|
||||||
|
delay: 2000
|
||||||
|
},
|
||||||
|
loop: true,
|
||||||
|
speed: 1000,
|
||||||
|
observer: true,
|
||||||
|
observeParents: true
|
||||||
|
},
|
||||||
|
swiperProducts: {
|
||||||
|
freeMode: true,
|
||||||
|
freeModeMomentum: false,
|
||||||
|
slidesPerView: 'auto',
|
||||||
|
observer: true,
|
||||||
|
observeParents: true
|
||||||
|
}
|
||||||
|
};
|
||||||
},
|
},
|
||||||
goHotNewGoods(type) {
|
onShow: function() {
|
||||||
this.$yrouter.push({
|
let that = this;
|
||||||
path: '/pages/shop/HotNewGoods/index',
|
uni.showLoading({
|
||||||
query: { type }
|
title: '加载中'
|
||||||
|
});
|
||||||
|
getHomeData().then(res => {
|
||||||
|
that.logoUrl = res.data.logoUrl;
|
||||||
|
that.$set(that, 'banner', res.data.banner);
|
||||||
|
that.$set(that, 'menus', res.data.menus);
|
||||||
|
that.$set(that, 'roll', res.data.roll);
|
||||||
|
that.$set(that, 'activity', res.data.activity);
|
||||||
|
var activityOne = res.data.activity.shift();
|
||||||
|
that.$set(that, 'activityOne', activityOne);
|
||||||
|
that.$set(that, 'info', res.data.info);
|
||||||
|
that.$set(that, 'firstList', res.data.firstList);
|
||||||
|
that.$set(that, 'bastList', res.data.bastList);
|
||||||
|
that.$set(that, 'likeInfo', res.data.likeInfo);
|
||||||
|
that.$set(that, 'lovely', res.data.lovely);
|
||||||
|
that.$set(that, 'benefit', res.data.benefit);
|
||||||
|
that.$set(that, 'couponList', res.data.couponList);
|
||||||
|
uni.hideLoading();
|
||||||
|
that.setOpenShare();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
goGoodsCon(item) {
|
methods: {
|
||||||
this.$yrouter.push({
|
goGoodSearch() {
|
||||||
path: '/pages/shop/GoodsCon/index',
|
this.$yrouter.push('/pages/shop/GoodSearch/index');
|
||||||
query: { id: item.id }
|
},
|
||||||
});
|
goWxappUrl(item) {
|
||||||
},
|
this.$yrouter.push(item.uniapp_url);
|
||||||
goGoodsPromotion() {
|
},
|
||||||
this.$yrouter.push('/pages/shop/GoodsPromotion/index');
|
goHotNewGoods(type) {
|
||||||
},
|
this.$yrouter.push({
|
||||||
setOpenShare: function() {},
|
path: '/pages/shop/HotNewGoods/index',
|
||||||
startQr:function(){
|
query: {
|
||||||
|
type
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goGoodsCon(item) {
|
||||||
|
this.$yrouter.push({
|
||||||
|
path: '/pages/shop/GoodsCon/index',
|
||||||
|
query: {
|
||||||
|
id: item.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goGoodsPromotion() {
|
||||||
|
this.$yrouter.push('/pages/shop/GoodsPromotion/index');
|
||||||
|
},
|
||||||
|
setOpenShare: function() {},
|
||||||
|
startQr: function() {
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success:function(res){
|
success: (res) =>{
|
||||||
console.log(JSON.stringify(res));
|
let option = handleUrlParam(res.result)
|
||||||
|
console.log(option)
|
||||||
|
|
||||||
|
|
||||||
|
// {productId: "19", spread: "21", codeType: "routine"}
|
||||||
|
// {productId: "19", spread: "21", pageType: "good", codeType: "routine"}
|
||||||
|
switch (option.pageType) {
|
||||||
|
case 'good':
|
||||||
|
// 跳转商品详情
|
||||||
|
this.$yrouter.push({path:'/pages/shop/GoodsCon/index',query:{
|
||||||
|
q:res.result
|
||||||
|
}});
|
||||||
|
break;
|
||||||
|
case 'group':
|
||||||
|
// 跳转团购
|
||||||
|
this.$yrouter.push({path:'/pages/activity/GroupRule/index',query:{
|
||||||
|
q:res.result
|
||||||
|
}});
|
||||||
|
break;
|
||||||
|
case 'dargain':
|
||||||
|
// 跳转砍价
|
||||||
|
this.$yrouter.push({path:'/pages/activity/DargainDetails/index',query:{
|
||||||
|
q:res.result
|
||||||
|
}});
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// 跳转分销
|
||||||
|
this.$yrouter.push({path:'/pages/Loading/index',query:{
|
||||||
|
|
||||||
|
}});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.index {
|
.index {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.swiper-item {
|
|
||||||
height: 100%;
|
.swiper-item {
|
||||||
}
|
height: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
imageuploaded(res) {
|
imageuploaded(res) {
|
||||||
if (res.status !== 200) {
|
if (res.status !== 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -97,7 +97,7 @@
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -137,7 +137,7 @@
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -150,4 +150,4 @@
|
|||||||
this.getRefundReason();
|
this.getRefundReason();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -140,7 +140,7 @@
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -149,7 +149,7 @@
|
|||||||
getExpress() {
|
getExpress() {
|
||||||
if (!this.id) {
|
if (!this.id) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -172,7 +172,7 @@
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -130,7 +130,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -150,7 +150,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -400,7 +400,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -135,6 +135,7 @@
|
|||||||
v-on:setPosterImageStatus="setPosterImageStatus"
|
v-on:setPosterImageStatus="setPosterImageStatus"
|
||||||
:posterImageStatus="posterImageStatus"
|
:posterImageStatus="posterImageStatus"
|
||||||
:posterData="posterData"
|
:posterData="posterData"
|
||||||
|
:goodId="id"
|
||||||
></StorePoster>
|
></StorePoster>
|
||||||
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
|
<ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
|
||||||
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
|
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
|
||||||
@ -258,6 +259,7 @@ export default {
|
|||||||
computed: mapGetters(["isLogin"]),
|
computed: mapGetters(["isLogin"]),
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
let url = handleQrCode();
|
let url = handleQrCode();
|
||||||
|
console.log(url);
|
||||||
if (url && url.productId) {
|
if (url && url.productId) {
|
||||||
this.id = url.productId;
|
this.id = url.productId;
|
||||||
} else {
|
} else {
|
||||||
@ -327,6 +329,7 @@ export default {
|
|||||||
if (this.$deviceType == "app") {
|
if (this.$deviceType == "app") {
|
||||||
form.form = "app";
|
form.form = "app";
|
||||||
}
|
}
|
||||||
|
uni.showLoading({ title: "加载中", mask: true });
|
||||||
getProductDetail(that.id, form)
|
getProductDetail(that.id, form)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
that.$set(that, "storeInfo", res.data.storeInfo);
|
that.$set(that, "storeInfo", res.data.storeInfo);
|
||||||
@ -370,6 +373,9 @@ export default {
|
|||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
uni.hideLoading();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//默认选中属性;
|
//默认选中属性;
|
||||||
@ -498,14 +504,14 @@ export default {
|
|||||||
},
|
},
|
||||||
changeattr: function(msg) {
|
changeattr: function(msg) {
|
||||||
// 修改了规格
|
// 修改了规格
|
||||||
console.log(msg)
|
console.log(msg);
|
||||||
this.attr.cartAttr = msg;
|
this.attr.cartAttr = msg;
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
},
|
},
|
||||||
//选择属性;
|
//选择属性;
|
||||||
ChangeAttr: function(res) {
|
ChangeAttr: function(res) {
|
||||||
// 修改了规格
|
// 修改了规格
|
||||||
console.log(res)
|
console.log(res);
|
||||||
let productSelect = this.productValue[res.value];
|
let productSelect = this.productValue[res.value];
|
||||||
if (productSelect) {
|
if (productSelect) {
|
||||||
this.attr.productAttr[res.indexw].index = res.indexn;
|
this.attr.productAttr[res.indexw].index = res.indexn;
|
||||||
|
@ -205,7 +205,7 @@
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -75,4 +75,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -73,7 +73,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch((err)=> {
|
.catch((err)=> {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -1,340 +1,329 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="register absolute">
|
<view class="register absolute">
|
||||||
<view class="shading">
|
<view class="shading">
|
||||||
<view class="pictrue acea-row row-center-wrapper">
|
<view class="pictrue acea-row row-center-wrapper">
|
||||||
<image src="@/static/images/logo.png" />
|
<image src="@/static/images/logo.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="whiteBg" v-if="formItem === 1">
|
<view class="whiteBg" v-if="formItem === 1">
|
||||||
<view class="title acea-row row-center-wrapper">
|
<view class="title acea-row row-center-wrapper">
|
||||||
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList" @click="navTap(index)"
|
<view
|
||||||
:key="index">{{ item }}</view>
|
class="item"
|
||||||
</view>
|
:class="current === index ? 'on' : ''"
|
||||||
<view class="list" :hidden="current !== 0">
|
v-for="(item, index) in navList"
|
||||||
<form @submit.prevent="submit">
|
@click="navTap(index)"
|
||||||
<view class="item">
|
:key="index"
|
||||||
<view class="acea-row row-between-wrapper">
|
>{{ item }}</view>
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
</view>
|
||||||
|
<view class="list" :hidden="current !== 0">
|
||||||
|
<form @submit.prevent="submit">
|
||||||
|
<view class="item">
|
||||||
|
<view class="acea-row row-between-wrapper">
|
||||||
|
<!-- <svg class="icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-phone_" />
|
<use xlink:href="#icon-phone_" />
|
||||||
</svg> -->
|
</svg>-->
|
||||||
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
<input type="text" placeholder="输入手机号码" v-model="account" required />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="acea-row row-between-wrapper">
|
<view class="acea-row row-between-wrapper">
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
<!-- <svg class="icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-code_" />
|
<use xlink:href="#icon-code_" />
|
||||||
</svg> -->
|
</svg>-->
|
||||||
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
<input type="password" placeholder="填写登录密码" v-model="password" required />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</form>
|
</form>
|
||||||
</view>
|
</view>
|
||||||
<view class="list" :hidden="current !== 1">
|
<view class="list" :hidden="current !== 1">
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="acea-row row-between-wrapper">
|
<view class="acea-row row-between-wrapper">
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
<!-- <svg class="icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-phone_" />
|
<use xlink:href="#icon-phone_" />
|
||||||
</svg> -->
|
</svg>-->
|
||||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="align-left">
|
<view class="align-left">
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
<!-- <svg class="icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-code_1" />
|
<use xlink:href="#icon-code_1" />
|
||||||
</svg> -->
|
</svg>-->
|
||||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">{{ text }}</button>
|
<button
|
||||||
</view>
|
class="code"
|
||||||
</view>
|
:disabled="disabled"
|
||||||
</view>
|
:class="disabled === true ? 'on' : ''"
|
||||||
<view class="logon" @click="loginMobile" :hidden="current !== 1">登录</view>
|
@click="code"
|
||||||
<view class="logon" @click="submit" :hidden="current === 1">登录</view>
|
>{{ text }}</button>
|
||||||
<view class="tip">
|
</view>
|
||||||
没有账号?
|
</view>
|
||||||
<text @click="formItem = 2" class="font-color-red">立即注册</text>
|
</view>
|
||||||
</view>
|
<view class="logon" @click="loginMobile" :hidden="current !== 1">登录</view>
|
||||||
</view>
|
<view class="logon" @click="submit" :hidden="current === 1">登录</view>
|
||||||
<view class="whiteBg" v-else>
|
<view class="tip">
|
||||||
<view class="title">注册账号</view>
|
没有账号?
|
||||||
<view class="list">
|
<text @click="formItem = 2" class="font-color-red">立即注册</text>
|
||||||
<view class="item">
|
</view>
|
||||||
<view>
|
</view>
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
<view class="whiteBg" v-else>
|
||||||
|
<view class="title">注册账号</view>
|
||||||
|
<view class="list">
|
||||||
|
<view class="item">
|
||||||
|
<view>
|
||||||
|
<!-- <svg class="icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-phone_" />
|
<use xlink:href="#icon-phone_" />
|
||||||
</svg> -->
|
</svg>-->
|
||||||
<input type="text" placeholder="输入手机号码" v-model="account" />
|
<input type="text" placeholder="输入手机号码" v-model="account" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="align-left">
|
<view class="align-left">
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
<!-- <svg class="icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-code_1" />
|
<use xlink:href="#icon-code_1" />
|
||||||
</svg> -->
|
</svg>-->
|
||||||
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
<input type="text" placeholder="填写验证码" class="codeIput" v-model="captcha" />
|
||||||
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="code">{{ text }}</button>
|
<button
|
||||||
</view>
|
class="code"
|
||||||
</view>
|
:disabled="disabled"
|
||||||
<view class="item">
|
:class="disabled === true ? 'on' : ''"
|
||||||
<view>
|
@click="code"
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
>{{ text }}</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view>
|
||||||
|
<!-- <svg class="icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-code_" />
|
<use xlink:href="#icon-code_" />
|
||||||
</svg> -->
|
</svg>-->
|
||||||
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
<input type="password" placeholder="填写您的登录密码" v-model="password" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view>
|
<view>
|
||||||
<!-- <svg class="icon" aria-hidden="true">
|
<!-- <svg class="icon" aria-hidden="true">
|
||||||
<use xlink:href="#icon-phone_" />
|
<use xlink:href="#icon-phone_" />
|
||||||
</svg> -->
|
</svg>-->
|
||||||
<input type="text" placeholder="输入邀请码" v-model="inviteCode" />
|
<input type="text" placeholder="输入邀请码" v-model="inviteCode" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="logon" @click="register">注册</view>
|
<view class="logon" @click="register">注册</view>
|
||||||
<view class="tip">
|
<view class="tip">
|
||||||
已有账号?
|
已有账号?
|
||||||
<text @click="formItem = 1" class="font-color-red">立即登录</text>
|
<text @click="formItem = 1" class="font-color-red">立即登录</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom"></view>
|
<view class="bottom"></view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
import sendVerifyCode from "@/mixins/SendVerifyCode";
|
||||||
import {
|
import { login, loginMobile, registerVerify, register } from "@/api/user";
|
||||||
login,
|
import attrs, { required, alpha_num, chs_phone } from "@/utils/validate";
|
||||||
loginMobile,
|
import { validatorDefaultCatch } from "@/utils/dialog";
|
||||||
registerVerify,
|
import dayjs from "dayjs";
|
||||||
register
|
import cookie from "@/utils/store/cookie";
|
||||||
} from "@/api/user";
|
|
||||||
import attrs, {
|
|
||||||
required,
|
|
||||||
alpha_num,
|
|
||||||
chs_phone
|
|
||||||
} from "@/utils/validate";
|
|
||||||
import {
|
|
||||||
validatorDefaultCatch
|
|
||||||
} from "@/utils/dialog";
|
|
||||||
import dayjs from "dayjs";
|
|
||||||
import cookie from "@/utils/store/cookie";
|
|
||||||
|
|
||||||
import {
|
import { handleGetUserInfo } from "@/utils";
|
||||||
handleGetUserInfo
|
|
||||||
} from '@/utils'
|
|
||||||
|
|
||||||
const BACK_URL = "login_back_url";
|
const BACK_URL = "login_back_url";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Login",
|
name: "Login",
|
||||||
mixins: [sendVerifyCode],
|
mixins: [sendVerifyCode],
|
||||||
data: function() {
|
data: function() {
|
||||||
return {
|
return {
|
||||||
navList: ["账号登录"],
|
navList: ["账号登录"],
|
||||||
current: 0,
|
current: 0,
|
||||||
account: "",
|
account: "",
|
||||||
password: "",
|
password: "",
|
||||||
captcha: "",
|
captcha: "",
|
||||||
inviteCode:"",
|
inviteCode: "",
|
||||||
formItem: 1,
|
formItem: 1,
|
||||||
type: "login"
|
type: "login"
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loginMobile() {
|
async loginMobile() {
|
||||||
var that = this;
|
var that = this;
|
||||||
const {
|
const { account, captcha } = that;
|
||||||
account,
|
try {
|
||||||
captcha
|
await that
|
||||||
} = that;
|
.$validator({
|
||||||
try {
|
account: [
|
||||||
await that
|
required(required.message("手机号码")),
|
||||||
.$validator({
|
chs_phone(chs_phone.message())
|
||||||
account: [
|
],
|
||||||
required(required.message("手机号码")),
|
captcha: [
|
||||||
chs_phone(chs_phone.message())
|
required(required.message("验证码")),
|
||||||
],
|
alpha_num(alpha_num.message("验证码"))
|
||||||
captcha: [
|
]
|
||||||
required(required.message("验证码")),
|
})
|
||||||
alpha_num(alpha_num.message("验证码"))
|
.validate({
|
||||||
]
|
account,
|
||||||
})
|
captcha
|
||||||
.validate({
|
});
|
||||||
account,
|
} catch (e) {
|
||||||
captcha
|
return validatorDefaultCatch(e);
|
||||||
});
|
}
|
||||||
} catch (e) {
|
loginMobile({
|
||||||
return validatorDefaultCatch(e);
|
phone: that.account,
|
||||||
}
|
captcha: that.captcha,
|
||||||
loginMobile({
|
spread: cookie.get("spread")
|
||||||
phone: that.account,
|
})
|
||||||
captcha: that.captcha,
|
.then(res => {
|
||||||
spread: cookie.get("spread")
|
var data = res.data;
|
||||||
})
|
that.$store.commit("LOGIN", data.token, dayjs(data.expires_time));
|
||||||
.then(res => {
|
handleGetUserInfo();
|
||||||
var data = res.data;
|
})
|
||||||
that.$store.commit("LOGIN", data.token, dayjs(data.expires_time));
|
.catch(err => {
|
||||||
handleGetUserInfo()
|
uni.showToast({
|
||||||
})
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
.catch(err => {
|
icon: "none",
|
||||||
uni.showToast({
|
duration: 2000
|
||||||
title: err.msg || err.response.data.msg,
|
});
|
||||||
icon: 'none',
|
});
|
||||||
duration: 2000
|
},
|
||||||
});
|
async register() {
|
||||||
});
|
var that = this;
|
||||||
},
|
const { account, captcha, password } = that;
|
||||||
async register() {
|
try {
|
||||||
var that = this;
|
await that
|
||||||
const {
|
.$validator({
|
||||||
account,
|
account: [
|
||||||
captcha,
|
required(required.message("手机号码")),
|
||||||
password
|
chs_phone(chs_phone.message())
|
||||||
} = that;
|
],
|
||||||
try {
|
captcha: [
|
||||||
await that
|
required(required.message("验证码")),
|
||||||
.$validator({
|
alpha_num(alpha_num.message("验证码"))
|
||||||
account: [
|
],
|
||||||
required(required.message("手机号码")),
|
password: [
|
||||||
chs_phone(chs_phone.message())
|
required(required.message("密码")),
|
||||||
],
|
attrs.range([6, 16], attrs.range.message("密码")),
|
||||||
captcha: [
|
alpha_num(alpha_num.message("密码"))
|
||||||
required(required.message("验证码")),
|
]
|
||||||
alpha_num(alpha_num.message("验证码"))
|
})
|
||||||
],
|
.validate({
|
||||||
password: [
|
account,
|
||||||
required(required.message("密码")),
|
captcha,
|
||||||
attrs.range([6, 16], attrs.range.message("密码")),
|
password
|
||||||
alpha_num(alpha_num.message("密码"))
|
});
|
||||||
]
|
} catch (e) {
|
||||||
})
|
return validatorDefaultCatch(e);
|
||||||
.validate({
|
}
|
||||||
account,
|
register({
|
||||||
captcha,
|
account: that.account,
|
||||||
password
|
captcha: that.captcha,
|
||||||
});
|
password: that.password,
|
||||||
} catch (e) {
|
inviteCode: that.inviteCode,
|
||||||
return validatorDefaultCatch(e);
|
spread: cookie.get("spread")
|
||||||
}
|
})
|
||||||
register({
|
.then(res => {
|
||||||
account: that.account,
|
uni.showToast({
|
||||||
captcha: that.captcha,
|
title: res.msg,
|
||||||
password: that.password,
|
icon: "success",
|
||||||
inviteCode: that.inviteCode,
|
duration: 2000
|
||||||
spread: cookie.get("spread")
|
});
|
||||||
})
|
that.formItem = 1;
|
||||||
.then(res => {
|
})
|
||||||
uni.showToast({
|
.catch(err => {
|
||||||
title: res.msg,
|
uni.showToast({
|
||||||
icon: "success",
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
duration: 2000
|
icon: "none",
|
||||||
});
|
duration: 2000
|
||||||
that.formItem = 1;
|
});
|
||||||
})
|
});
|
||||||
.catch(err => {
|
},
|
||||||
uni.showToast({
|
async code() {
|
||||||
title: err.msg || err.response.data.msg,
|
var that = this;
|
||||||
icon: "none",
|
const { account } = that;
|
||||||
duration: 2000
|
try {
|
||||||
});
|
await that
|
||||||
});
|
.$validator({
|
||||||
},
|
account: [
|
||||||
async code() {
|
required(required.message("手机号码")),
|
||||||
var that = this;
|
chs_phone(chs_phone.message())
|
||||||
const {
|
]
|
||||||
account
|
})
|
||||||
} = that;
|
.validate({
|
||||||
try {
|
account
|
||||||
await that
|
});
|
||||||
.$validator({
|
} catch (e) {
|
||||||
account: [
|
return validatorDefaultCatch(e);
|
||||||
required(required.message("手机号码")),
|
}
|
||||||
chs_phone(chs_phone.message())
|
if (that.formItem == 2) that.type = "register";
|
||||||
]
|
await registerVerify({
|
||||||
})
|
phone: that.account,
|
||||||
.validate({
|
type: that.type
|
||||||
account
|
})
|
||||||
});
|
.then(res => {
|
||||||
} catch (e) {
|
uni.showToast({
|
||||||
return validatorDefaultCatch(e);
|
title: res.msg,
|
||||||
}
|
icon: "success",
|
||||||
if (that.formItem == 2) that.type = "register";
|
duration: 2000
|
||||||
await registerVerify({
|
});
|
||||||
phone: that.account,
|
that.sendCode();
|
||||||
type: that.type
|
})
|
||||||
})
|
.catch(err => {
|
||||||
.then(res => {
|
uni.showToast({
|
||||||
uni.showToast({
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
title: res.msg,
|
icon: "none",
|
||||||
icon: "success",
|
duration: 2000
|
||||||
duration: 2000
|
});
|
||||||
});
|
});
|
||||||
that.sendCode();
|
},
|
||||||
})
|
navTap: function(index) {
|
||||||
.catch(err => {
|
this.current = index;
|
||||||
uni.showToast({
|
},
|
||||||
title: err.msg || err.response.data.msg,
|
async submit() {
|
||||||
icon: "none",
|
const { account, password } = this;
|
||||||
duration: 2000
|
try {
|
||||||
});
|
await this.$validator({
|
||||||
});
|
account: [
|
||||||
},
|
required(required.message("账号")),
|
||||||
navTap: function(index) {
|
attrs.range([5, 16], attrs.range.message("账号")),
|
||||||
this.current = index;
|
alpha_num(alpha_num.message("账号"))
|
||||||
},
|
],
|
||||||
async submit() {
|
password: [
|
||||||
const {
|
required(required.message("密码")),
|
||||||
account,
|
attrs.range([6, 16], attrs.range.message("密码")),
|
||||||
password
|
alpha_num(alpha_num.message("密码"))
|
||||||
} = this;
|
]
|
||||||
try {
|
}).validate({
|
||||||
await this.$validator({
|
account,
|
||||||
account: [
|
password
|
||||||
required(required.message("账号")),
|
});
|
||||||
attrs.range([5, 16], attrs.range.message("账号")),
|
} catch (e) {
|
||||||
alpha_num(alpha_num.message("账号"))
|
return validatorDefaultCatch(e);
|
||||||
],
|
}
|
||||||
password: [
|
|
||||||
required(required.message("密码")),
|
|
||||||
attrs.range([6, 16], attrs.range.message("密码")),
|
|
||||||
alpha_num(alpha_num.message("密码"))
|
|
||||||
]
|
|
||||||
}).validate({
|
|
||||||
account,
|
|
||||||
password
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
return validatorDefaultCatch(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
login({
|
login({
|
||||||
username: account,
|
username: account,
|
||||||
password,
|
password,
|
||||||
spread: cookie.get("spread")
|
spread: cookie.get("spread")
|
||||||
})
|
})
|
||||||
.then(({
|
.then(({ data }) => {
|
||||||
data
|
this.$store.commit("LOGIN", data.token, dayjs(data.expires_time));
|
||||||
}) => {
|
handleGetUserInfo();
|
||||||
this.$store.commit("LOGIN", data.token, dayjs(data.expires_time));
|
// let replace=this.$yroute.query.replace
|
||||||
handleGetUserInfo()
|
// if(replace){
|
||||||
// let replace=this.$yroute.query.replace
|
|
||||||
// if(replace){
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// this.$yrouter.replace({
|
// this.$yrouter.replace({
|
||||||
// path: this.$yroute.query.replace || '/pages/home/index'
|
// path: this.$yroute.query.replace || '/pages/home/index'
|
||||||
// });
|
// });
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
console.log(err);
|
||||||
title: err.msg || err.response.data.msg,
|
uni.showToast({
|
||||||
icon: "none",
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
duration: 2000
|
icon: "none",
|
||||||
});
|
duration: 2000
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -156,7 +156,7 @@ export default {
|
|||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -214,7 +214,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -97,7 +97,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -174,7 +174,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -109,7 +109,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -141,7 +141,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -75,7 +75,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -92,7 +92,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -97,7 +97,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -165,7 +165,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -182,7 +182,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -201,7 +201,7 @@ export default {
|
|||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -211,7 +211,7 @@ export default {
|
|||||||
// .catch(err => {
|
// .catch(err => {
|
||||||
// uni.hideLoading();
|
// uni.hideLoading();
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: err.msg || err.response.data.msg,
|
// title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
// icon: 'none',
|
// icon: 'none',
|
||||||
// duration: 2000
|
// duration: 2000
|
||||||
// });
|
// });
|
||||||
|
@ -76,7 +76,7 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(function(err) {
|
.catch(function(err) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -76,7 +76,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -91,7 +91,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -77,7 +77,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -92,7 +92,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -74,7 +74,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -157,7 +157,7 @@
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -92,7 +92,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -103,7 +103,7 @@ export default {
|
|||||||
},
|
},
|
||||||
function(err) {
|
function(err) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -200,7 +200,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -84,7 +84,7 @@ export default {
|
|||||||
},
|
},
|
||||||
function(err) {
|
function(err) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -135,7 +135,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
@ -150,7 +150,7 @@ export default {
|
|||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: err.msg || err.response.data.msg,
|
title: err.msg || err.response.data.msg|| err.response.data.message,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 2000
|
duration: 2000
|
||||||
});
|
});
|
||||||
|
@ -27,9 +27,9 @@ const dialog = {
|
|||||||
// notify,
|
// notify,
|
||||||
loading: {
|
loading: {
|
||||||
open: () => {
|
open: () => {
|
||||||
uni.showLoading({
|
// uni.showLoading({
|
||||||
title: '加载中'
|
// title: '加载中'
|
||||||
})
|
// })
|
||||||
},
|
},
|
||||||
close: () => {
|
close: () => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
@ -459,19 +459,23 @@ export function handleQrCode() {
|
|||||||
try {
|
try {
|
||||||
var urlSpread = parseQuery()["q"];
|
var urlSpread = parseQuery()["q"];
|
||||||
if (urlSpread) {
|
if (urlSpread) {
|
||||||
// 通过海报二维码进来
|
if (urlSpread.indexOf('%3F') != -1) {
|
||||||
urlSpread = urlSpread
|
// 通过海报二维码进来
|
||||||
.split("%3F")[1]
|
urlSpread = urlSpread
|
||||||
.replace(/%3D/g, ":")
|
.split("%3F")[1]
|
||||||
.replace(/%26/g, ",")
|
.replace(/%3D/g, ":")
|
||||||
.split(",")
|
.replace(/%26/g, ",")
|
||||||
.map((item, index) => {
|
.split(",")
|
||||||
item = item.split(":");
|
.map((item, index) => {
|
||||||
return `"${item[0]}":"${item[1]}"`;
|
item = item.split(":");
|
||||||
})
|
return `"${item[0]}":"${item[1]}"`;
|
||||||
.join(",");
|
})
|
||||||
urlSpread = JSON.parse("{" + urlSpread + "}");
|
.join(",");
|
||||||
return urlSpread
|
urlSpread = JSON.parse("{" + urlSpread + "}");
|
||||||
|
return urlSpread
|
||||||
|
} else {
|
||||||
|
return handleUrlParam(urlSpread)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
} catch {
|
} catch {
|
||||||
@ -480,6 +484,19 @@ export function handleQrCode() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function handleUrlParam(path) {
|
||||||
|
console.log(path)
|
||||||
|
|
||||||
|
var url = path.split("?")[1]; //获取url中"?"符后的字串
|
||||||
|
console.log(url)
|
||||||
|
var theRequest = new Object();
|
||||||
|
let strs = url.split("&");
|
||||||
|
for (var i = 0; i < strs.length; i++) {
|
||||||
|
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
|
||||||
|
}
|
||||||
|
return theRequest;
|
||||||
|
}
|
||||||
|
|
||||||
const getImageInfo = (images) => {
|
const getImageInfo = (images) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let imageAry = {}
|
let imageAry = {}
|
||||||
|
Reference in New Issue
Block a user