切换商户修改-0712

master
Lee-1203 2022-07-12 18:07:08 +08:00
parent fe296c0d0d
commit f3c83a49e5
99 changed files with 918 additions and 450 deletions

30
App.vue
View File

@ -23,40 +23,24 @@
uni.setStorageSync('phone_active',result.data.data.phone_active);//
uni.setStorageSync('is_active',result.data.data.is_active);//
uni.setStorageSync('invite_code',result.data.data.invite_code);//
let headers = {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
};
}
}
})
}
})
},
onShow: function(op) {
if(op.query.business_id){
uni.setStorageSync('business_id',op.query.business_id);
this.changeEv(op.query.business_id);
}else{
uni.setStorageSync('business_id',0);
this.changeEv(0);
}
onShow: function() {
},
onHide: function() {
},
methods:{
changeEv(id){
let headers = {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
}
uni.request({
url: this.globalData.hostapi +'/api/index/change-business',
data:{business_id:id},
methods:'POST',
header:headers,
success: (res) => {
console.log(id,'操作成功')
}
})
}
}
};
</script>

View File

@ -23,6 +23,7 @@ page {background-color: #eaeaea;}
font-weight: bold;
margin-top: 30rpx;
color: #333333;
text-align: center;
}
.login-footer {
@ -36,6 +37,7 @@ page {background-color: #eaeaea;}
.login-btn {
width: 70%;
height: 80rpx;
line-height: 80rpx;
margin: 0 auto;
box-shadow: 0rpx 0rpx 10rpx rgba(0,115,188, .5);
}
@ -130,6 +132,19 @@ page {background-color: #eaeaea;}
margin-bottom: 12rpx;
}
/* 关键词 */
.search-keyword{
padding: 25rpx 30rpx 0;
font-size: 30rpx;
line-height: 1.5;
color: #666666;
}
.search-keyword>text:first-child{
margin-right: 24rpx;
}
.search-keyword>text:last-child{
margin: 0 6rpx;
}
/* 推荐列表 */
.flag-list {
justify-content: space-between;
@ -1211,6 +1226,7 @@ video#my-video{
.about-bg{
box-sizing: border-box;
padding: 20rpx 30rpx;
background-color: #FFFFFF;
}
.about-map{
border-radius: 30rpx;
@ -1229,7 +1245,7 @@ video#my-video{
.about-title{
font-size: 48rpx;
line-height: 1.5;
margin: 75rpx 0;
margin: 70rpx 0;
color: #000000;
}
.about-txt{

View File

@ -1,5 +1,6 @@
import requst from './requst.js';
import store from '@/store/index.js'
// 查询轮播位置
export function slidePosition(data) {
return requst.get("/api/common/slide-positions");

View File

@ -10,6 +10,16 @@ let flag = true;
var authTimer = null;
const refreshTokenPage = () => {
clearTimeout(authTimer);
// 获取当前页面路径
let currentRoutes = getCurrentPages(); // 获取当前打开过的页面路由数组
let currentRoute = currentRoutes[currentRoutes.length - 1].route //获取当前页面路由
let currentParam = currentRoutes[currentRoutes.length - 1].options; //获取路由参数
// 拼接参数
let param = ''
for (let key in currentParam) {
param += '?' + key + '=' + currentParam[key]
}
let localRoute = '/'+ currentRoute + param;
uni.login({
success: (res) => {
uni.request({
@ -24,9 +34,9 @@ const refreshTokenPage = () => {
uni.setStorageSync('phone_active',result.data.data.phone_active);//是否授权手机号
uni.setStorageSync('is_active',result.data.data.is_active);//是否授权头像和昵称
uni.setStorageSync('invite_code',result.data.data.invite_code);//缓存邀请码
if(uni.getStorageSync('page-path-options')) {
if(localRoute) {
uni.reLaunch({ // 重新进入当前页面
url:uni.getStorageSync('page-path-options')
url:localRoute
})
} else {
uni.reLaunch({

View File

@ -24,8 +24,16 @@
agreement:'',
}
},
onLoad() {
this.getDisclaimers();
onLoad(op) {
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getDisclaimers();
}
})
}else{
this.getDisclaimers();
}
},
methods: {
//

View File

@ -70,14 +70,18 @@
}),
},
onLoad(op) {
let business_id = uni.getStorageSync('business_id');
if(business_id ==0){
this.businessId = 0;
this.getCompanyList(0);
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getUserInfo();
}
})
}else{
this.businessId = business_id;
this.getCompanyList(business_id); //
this.getUserInfo();
}
},
onShow() {
},
onReachBottom(e) {
@ -103,6 +107,7 @@
this.$requst.get('/api/user/info').then(res=>{
if(res.code==0) {
this.businessId = res.data.business_id;
this.getCompanyList(res.data.business_id); //
this.getCateList(res.data.business_id); //
}
})

View File

@ -95,15 +95,24 @@
geList: state => state.moduleA.geList,
}),
},
onLoad(op) {
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getHomeData();
this.getArticleNav();
}
})
}else{
this.getHomeData();
this.getArticleNav();
}
},
onShow() {
this.playTimer = setTimeout(()=>{
this.isplay = true;
},2000)
},
onLoad() {
this.getHomeData();
this.getArticleNav();
},
onReady() {
},
@ -125,9 +134,6 @@
if(this.articleList.length<this.total){
this.page++;
this.getArticleList();
}else{
this.totalAll = this.total;
return false;
}
},
onHide() {
@ -206,6 +212,9 @@
newArr.push(obj)
})
this.articleList = newArr;
if(this.articleList.length == this.total){
this.totalAll = this.total;
}
}
uni.hideLoading();
})

View File

@ -10,8 +10,8 @@
<view class="shop-title">{{kitDetail.name}}</view>
<view class="shop-txt flex">
<view class="left">
<view class="shop-customized">{{kitDetail.customized==1?'可定制':'不可定制'}}</view>
<view class="kit-compose">{{kitDetail.subtitle}}</view>
<view class="shop-customized">{{kitDetail.customized==1?'可定制':'不可定制'}}</view>
<view class="shop-pric">{{kitDetail.price}}</view>
</view>
<view class="right flex">
@ -86,8 +86,17 @@
},
onLoad(op) {
if(op !== ''){
this.id = op.id;
this.getKitDetail(this.id);
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.id = op.id;
this.getKitDetail(this.id);
}
})
}else{
this.id = op.id;
this.getKitDetail(this.id);
}
}
},
onShow() {

View File

@ -24,6 +24,8 @@
</view>
</view>
</view>
<!-- 暂无更多内容 -->
<view class="more-txt" v-if="totalAll == total"></view>
<!-- 购物车btn -->
<enter-cart></enter-cart>
<!-- 底部tab -->
@ -63,15 +65,21 @@
}),
},
onLoad(op) {
this.getKitEv();
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getKitEv();
}
})
}else{
this.getKitEv();
}
},
onReachBottom(e) {
if(this.kitList.length<this.total){
this.page++;
//
this.getKitEv();
}else{
this.totalAll = this.total;
}
},
//
@ -101,7 +109,6 @@
this.$requst.post('/api/spu/series',params).then(res=>{
if(res.code==0) {
this.total = res.data.total;
console.log(res,'套件列表')
let newArr = [];
res.data.list.forEach(item=>{
let obj = {
@ -113,6 +120,9 @@
newArr.push(obj);
})
this.kitList = newArr;
if(this.kitList.length == this.total){
this.totalAll = this.total;
}
}
uni.hideLoading();
})

View File

@ -151,9 +151,18 @@
onHide() {
},
onLoad() {
this.getUserInfo();
this.getCustomer();
onLoad(op) {
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getUserInfo();
this.getCustomer();
}
})
}else{
this.getUserInfo();
this.getCustomer();
}
},
onShow() {
@ -165,6 +174,7 @@
this.$requst.get('/api/user/info').then(res=>{
console.log(res,'用户信息')
if(res.code==0) {
uni.setStorageSync('business_id',res.data.business_id);
let newArr = res.data.order_count;
this.headPortrait = res.data.headimgurl,
this.nickName = res.data.nickname

View File

@ -49,11 +49,19 @@
footHeight: state => state.moduleA.footHeight,
}),
},
onLoad() {
onLoad(op) {
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getCollectionList();
}
})
}else{
this.getCollectionList();
}
},
onReady() {
this.getCollectionList();
},
onReachBottom(e) {
if(this.collectionList.length<this.total){

View File

@ -66,7 +66,15 @@
},
onLoad(op) {
this.id = op.id;
this.getDetail(this.id);
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getDetail(this.id);
}
})
}else{
this.getDetail(this.id);
}
},
onShow() {
// getNewsDetail()

View File

@ -52,16 +52,21 @@
footHeight: state => state.moduleA.footHeight,
}),
},
onLoad() {
this.getArticleNav();
onLoad(op) {
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getArticleNav();
}
})
}else{
this.getArticleNav();
}
},
onReachBottom(e) {
if(this.articleList.length<this.total){
this.page++;
this.getArticleList();
}else{
this.totalAll = this.total;
return false;
}
},
//
@ -98,7 +103,6 @@
},
//
chooseEv(index,id){
console.log(index,id,1212121)
if(this.currentIndex !== index){
this.articleList = [];
this.page = 1;
@ -130,6 +134,9 @@
newArr.push(obj)
})
this.articleList = newArr;
if(this.articleList.length == this.total){
this.totalAll = this.total;
}
}
uni.hideLoading();
})

View File

@ -15,14 +15,18 @@
<view @tap="saveImg" class="cope-btn">保存二维码</view>
<view @tap="goShop" class="shoping-btn">继续购物</view>
</view>
<!-- 客服btn -->
<customer-service></customer-service>
</view>
</template>
<script>
import statusNav from '@/components/status-navs/status-nav';
import customerService from '@/components/customer-service/customer-service.vue';
export default {
components:{
statusNav
statusNav,
customerService
},
data() {
return {
@ -31,7 +35,6 @@
}
},
onLoad(op) {
console.log(op,'传值')
this.orderCode = op.coding;
this.$requst.get('/api/user/business-qr',{id:op.id}).then(res=>{
if(res.code==0) {

View File

@ -59,11 +59,19 @@
flag:true
}
},
onLoad() {
console.log(uni.getStorageSync('buyList'),'缓存数组')
onLoad(op) {
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getUserInfo()
}
})
}else{
this.getUserInfo()
}
},
onShow() {
this.getUserInfo()
},
methods: {
//
@ -109,6 +117,8 @@
this.$toolAll.tools.showToast('请正确填写联系电话');
} else if(!this.address) {
this.$toolAll.tools.showToast('请填写收货地址');
} else if(!this.toTime) {
this.$toolAll.tools.showToast('请选择送货时间');
} else {
result = true;
}

View File

@ -82,7 +82,15 @@
if(op.id !== ''){
this.id = op.id;
}
this.getOrderDetail();
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getOrderDetail();
}
})
}else{
this.getOrderDetail();
}
},
//
onShareAppMessage() {

View File

@ -32,7 +32,9 @@
</view>
</view>
</view>
<view v-if="totalAll == total"><pitera textStr="—— 到底啦 ——"></pitera></view>
<!-- 到底啦 -->
<view class="more-txt" style="padding-bottom: 40rpx;" v-if="totalAll == total"> </view>
<nothing-page v-if="!ifLoading && !orderList.length" content="还没有相关订单哟(*^▽^*)"></nothing-page>
</view>
</template>
@ -57,7 +59,7 @@
flag:true,
ifLoading:false,
total:0,
totalAll:0,
totalAll:-1,
page: 1,
size: 10,
tag: 'all'
@ -70,15 +72,20 @@
if(op.index !== ''){
this.activeIndex = op.index;
}
this.getOrderList();
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getOrderList();
}
})
}else{
this.getOrderList();
}
},
onReachBottom(e) {
if(this.orderList.length<this.total){
this.page++;
this.getOrderList();
}else{
this.totalAll = this.total;
return false;
}
},
//
@ -115,6 +122,7 @@
this.$requst.get('/api/user/order',params).then(res=>{
if(res.data.length!=0){
this.total = res.data.total;
let newArr = [];
res.data.list.forEach(item=>{
let obj = {
id: item.id, //id
@ -124,9 +132,12 @@
status_text: item.status_text, //
skus: item.skus //
}
this.orderList.push(obj)
newArr.push(obj);
})
// console.log(this.orderList,'')
this.orderList =newArr;
if(this.orderList.length == this.total){
this.totalAll = this.total;
}
}
uni.hideLoading();
})

View File

@ -118,7 +118,15 @@
if(op !== ''){
this.source = op.source;
this.id = op.id;
this.getDetail(this.id);
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getDetail(this.id);
}
})
}else{
this.getDetail(this.id);
}
}
},
onShow() {

View File

@ -73,15 +73,21 @@
onLoad(op) {
this.category_id = op.category_id;
this.business_id = op.business_id;
this.getShopScreen(); //
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getShopScreen(); //
}
})
}else{
this.getShopScreen(); //
}
},
onReachBottom(e) {
if(this.shopList.length<this.total){
this.page++;
//
this.getShopList();
}else{
this.totalAll = this.total;
}
},
methods: {
@ -144,7 +150,6 @@
}
this.$requst.post('/api/spu/condition',params).then(res=>{
if(res.code==0) {
console.log(res,'商品分类')
this.sortList = res.data[0].children; //
this.cateList = res.data[1].children; //
for(let key in this.cateList){
@ -171,7 +176,6 @@
this.$requst.post('/api/spu/list',params).then(res=>{
if(res.code==0) {
this.total = res.data.total;
console.log(res,'商品列表')
let newArr = [];
res.data.list.forEach(item=>{
let obj = {
@ -182,6 +186,9 @@
newArr.push(obj);
})
this.shopList = newArr;
if(this.shopList.length == this.total){
this.totalAll = this.total;
}
}
uni.hideLoading();
})

View File

@ -10,7 +10,7 @@
<view class="navigation-btn" @tap="goThere"></view>
<!-- 内容 -->
<view class="about">
<view class="about-title">免责条款</view>
<view class="about-title">关于我们</view>
<view class="about-txt">
<rich-text :nodes="aboutData"></rich-text>
</view>
@ -43,8 +43,16 @@
aboutData:'',
}
},
onLoad() {
this.getAboutData();
onLoad(op) {
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getAboutData();
}
})
}else{
this.getAboutData();
}
},
//
onShareAppMessage() {

View File

@ -25,8 +25,16 @@
disclaimers:'',
}
},
onLoad() {
this.getDisclaimers();
onLoad(op) {
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getDisclaimers();
}
})
}else{
this.getDisclaimers();
}
},
methods: {
//

View File

@ -15,13 +15,14 @@
<nav-tab :list="navTabList" @chooseEv="chooseEv" :type="'radio'"></nav-tab>
</view>
<!-- 历史搜索 -->
<view class="search-history flex" v-if="historyData.length>0">
<view class="search-history flex" v-if="historyData.length>0 && total==0">
<view class="title flex">
<text>历史搜索</text>
<image class="search-img" src="/static/public/icon-clear.png" mode="widthFix" @tap="clearHistory"></image>
</view>
<view class="item clips1" @tap="changeKeyword(item.keyword)" v-for="(item,index) in historyData" :key="index">{{item.keyword}}</view>
</view>
<view class="search-keyword" v-if="total !== 0"><text>{{keywords}}</text>(<text>{{total}}</text>)</view>
<!-- 列表 -->
<view class="news-list-bg">
<pull-list :list="searchList" :isShop="isShop" @toDetail="toDetail"></pull-list>
@ -59,6 +60,7 @@
totalAll:-1, //
historyData:[], //
keyword:'',//
keywords:'', //
}
},
computed:{
@ -67,19 +69,15 @@
}),
},
onLoad(op) {
this.keyword = op.keyword;
this.getSearchList();
this.keywords = op.keyword;
this.getSearchList(this.keywords);
this.getHistory();
},
onReachBottom(e) {
if(this.searchList.length<this.total){
this.page++;
this.getSearchList();
}else{
this.totalAll = this.total;
return false;
}
},
methods: {
//
@ -131,24 +129,43 @@
//
toSearch(){
if(this.keyword !== ''){
this.keywords = this.keyword;
this.getSearchList();
this.getHistory();
}
},
//
changeKeyword(keyword){
this.keyword = keyword;
this.getSearchList();
this.getHistory();
this.keywords =keyword;
let isRequest = uni.getStorageSync('isRequest');
if(isRequest){
this.getSearchList();
this.getHistory();
}
},
//
clearHistory(){
if(this.currentIndex == 0){
this.$requst.get('/api/index/clear-keyword-history',{type:'spu'}).then(res=>{
if(res.code == 0){
this.historyData = [];
}
})
}
if(this.currentIndex == 1){
this.$requst.get('/api/index/clear-keyword-history',{type:'article'}).then(res=>{
if(res.code == 0){
this.historyData = [];
}
})
}
},
//
getSearchList(){
let params = {
keyword:this.keyword
keyword:this.keywords
}
if(this.currentIndex == 0){
this.$requst.get('/api/spu/list',params).then(res=>{
@ -165,6 +182,10 @@
newArr.push(obj)
})
this.searchList = newArr;
this.keyword = '';
if(this.searchList.length == this.total){
this.totalAll = this.total;
}
}
})
}
@ -183,6 +204,10 @@
newArr.push(obj)
})
this.searchList = newArr;
this.keyword = '';
if(this.searchList.length == this.total){
this.totalAll = this.total;
}
}
})
}

View File

@ -4,7 +4,7 @@
<view class="ucenter">
<view class="item flex">
<view class="title">头像</view>
<view class="img" @tap="changeHeadImg">
<view class="img"><!-- @tap="changeHeadImg" -->
<image :src="headImgUrl" mode="widthFix"></image>
</view>
</view>
@ -94,7 +94,15 @@
},
onLoad(op) {
this.getUserData();
if(op.business_id){
this.$requst.post('/api/index/change-business',{business_id:op.business_id}).then(res=>{
if(res.code == 0){
this.getUserData();
}
})
}else{
this.getUserData();
}
},
onShow() {
},

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -134,40 +134,23 @@ var _publicApi = __webpack_require__(/*! @/jsFile/public-api.js */ 9);var _defau
uni.setStorageSync('phone_active', result.data.data.phone_active); //是否授权手机号
uni.setStorageSync('is_active', result.data.data.is_active); //是否授权头像和昵称
uni.setStorageSync('invite_code', result.data.data.invite_code); //缓存邀请码
var headers = {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer ' + uni.getStorageSync('token') || false };
}
} });
} });
},
onShow: function onShow(op) {
if (op.query.business_id) {
uni.setStorageSync('business_id', op.query.business_id);
this.changeEv(op.query.business_id);
} else {
uni.setStorageSync('business_id', 0);
this.changeEv(0);
}
onShow: function onShow() {
},
onHide: function onHide() {
},
methods: {
changeEv: function changeEv(id) {
var headers = {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer ' + uni.getStorageSync('token') || false };
uni.request({
url: this.globalData.hostapi + '/api/index/change-business',
data: { business_id: id },
methods: 'POST',
header: headers,
success: function success(res) {
console.log(id, '操作成功');
} });
} } };exports.default = _default;
methods: {} };exports.default = _default;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
/***/ }),

View File

@ -29,22 +29,6 @@
@ -618,6 +602,7 @@ page {background-color: #eaeaea;}
font-weight: bold;
margin-top: 30rpx;
color: #333333;
text-align: center;
}
.login-footer {
width: 100%;
@ -629,6 +614,7 @@ page {background-color: #eaeaea;}
.login-btn {
width: 70%;
height: 80rpx;
line-height: 80rpx;
margin: 0 auto;
box-shadow: 0rpx 0rpx 10rpx rgba(0,115,188, .5);
}
@ -717,6 +703,20 @@ page {background-color: #eaeaea;}
margin-bottom: 12rpx;
}
/* 关键词 */
.search-keyword{
padding: 25rpx 30rpx 0;
font-size: 30rpx;
line-height: 1.5;
color: #666666;
}
.search-keyword>text:first-child{
margin-right: 24rpx;
}
.search-keyword>text:last-child{
margin: 0 6rpx;
}
/* 推荐列表 */
.flag-list {
justify-content: space-between;
@ -1782,6 +1782,7 @@ video#my-video{
.about-bg{
box-sizing: border-box;
padding: 20rpx 30rpx;
background-color: #FFFFFF;
}
.about-map{
border-radius: 30rpx;
@ -1800,7 +1801,7 @@ video#my-video{
.about-title{
font-size: 48rpx;
line-height: 1.5;
margin: 75rpx 0;
margin: 70rpx 0;
color: #000000;
}
.about-txt{

View File

@ -1400,7 +1400,7 @@ function initData(vueOptions, context) {
try {
data = data.call(context); // 支持 Vue.prototype 上挂的数据
} catch (e) {
if (Object({"VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
}
}
@ -8479,7 +8479,7 @@ function type(obj) {
function flushCallbacks$1(vm) {
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
if (Object({"VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
@ -8500,14 +8500,14 @@ function nextTick$1(vm, cb) {
//1.nextTick 之前 已 setData 且 setData 还未回调完成
//2.nextTick 之前存在 render watcher
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
if(Object({"VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"NODE_ENV":"development","VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:nextVueTick');
}
return nextTick(cb, vm)
}else{
if(Object({"VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"NODE_ENV":"development","VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance$1 = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
']:nextMPTick');
@ -8593,7 +8593,7 @@ var patch = function(oldVnode, vnode) {
});
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
if (Object.keys(diffData).length) {
if (Object({"VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_NAME":"app适配微信小程序","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
']差量更新',
JSON.stringify(diffData));
@ -9025,6 +9025,7 @@ internalMixin(Vue);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });exports.slidePosition = slidePosition;exports.getCartNum = getCartNum;var _requst = _interopRequireDefault(__webpack_require__(/*! ./requst.js */ 10));
var _index = _interopRequireDefault(__webpack_require__(/*! @/store/index.js */ 11));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
// 查询轮播位置
function slidePosition(data) {
return _requst.default.get("/api/common/slide-positions");
@ -9060,6 +9061,16 @@ var flag = true;
var authTimer = null;
var refreshTokenPage = function refreshTokenPage() {
clearTimeout(authTimer);
// 获取当前页面路径
var currentRoutes = getCurrentPages(); // 获取当前打开过的页面路由数组
var currentRoute = currentRoutes[currentRoutes.length - 1].route; //获取当前页面路由
var currentParam = currentRoutes[currentRoutes.length - 1].options; //获取路由参数
// 拼接参数
var param = '';
for (var key in currentParam) {
param += '?' + key + '=' + currentParam[key];
}
var localRoute = '/' + currentRoute + param;
uni.login({
success: function success(res) {
uni.request({
@ -9074,9 +9085,9 @@ var refreshTokenPage = function refreshTokenPage() {
uni.setStorageSync('phone_active', result.data.data.phone_active); //是否授权手机号
uni.setStorageSync('is_active', result.data.data.is_active); //是否授权头像和昵称
uni.setStorageSync('invite_code', result.data.data.invite_code); //缓存邀请码
if (uni.getStorageSync('page-path-options')) {
if (localRoute) {
uni.reLaunch({ // 重新进入当前页面
url: uni.getStorageSync('page-path-options') });
url: localRoute });
} else {
uni.reLaunch({

View File

@ -0,0 +1 @@
Component({})

View File

@ -0,0 +1,5 @@
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"usingComponents": {}
}

View File

@ -0,0 +1 @@
<view class="data-v-92bb8f34"></view>

View File

@ -0,0 +1 @@
/* pages/home/home.wxss */

View File

@ -156,17 +156,25 @@ var _default = {
agreement: '' };
},
onLoad: function onLoad() {
this.getDisclaimers();
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getDisclaimers();
}
});
} else {
this.getDisclaimers();
}
},
methods: {
// 查询免责声明
getDisclaimers: function getDisclaimers() {var _this = this;
getDisclaimers: function getDisclaimers() {var _this2 = this;
this.$requst.get('/api/index/agreement').then(function (res) {
if (res.code == 0) {
_this.agreement = _this.$toolAll.tools.escape2Html(res.data.content);
_this2.agreement = _this2.$toolAll.tools.escape2Html(res.data.content);
} else {
_this.$toolAll.tools.showToast(res.msg);
_this2.$toolAll.tools.showToast(res.msg);
}
});
} } };exports.default = _default;

View File

@ -227,15 +227,19 @@ var _default = {
footHeight: function footHeight(state) {return state.moduleA.footHeight;} })),
onLoad: function onLoad(op) {
var business_id = uni.getStorageSync('business_id');
if (business_id == 0) {
this.businessId = 0;
this.getCompanyList(0);
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getUserInfo();
}
});
} else {
this.businessId = business_id;
this.getCompanyList(business_id); //查询商户
this.getUserInfo();
}
},
onShow: function onShow() {
},
onReachBottom: function onReachBottom(e) {
@ -256,12 +260,13 @@ var _default = {
},
methods: {
// 获取用户信息
getUserInfo: function getUserInfo() {var _this = this;
getUserInfo: function getUserInfo() {var _this2 = this;
uni.showLoading();
this.$requst.get('/api/user/info').then(function (res) {
if (res.code == 0) {
_this.businessId = res.data.business_id;
_this.getCateList(res.data.business_id); //查询一级分类
_this2.businessId = res.data.business_id;
_this2.getCompanyList(res.data.business_id); //查询商户
_this2.getCateList(res.data.business_id); //查询一级分类
}
});
},
@ -293,36 +298,36 @@ var _default = {
this.getSecondList(this.cateIndex);
},
// 查询工厂列表
getCompanyList: function getCompanyList(business_id) {var _this2 = this;
getCompanyList: function getCompanyList(business_id) {var _this3 = this;
this.$requst.get('/api/spu/business', { business_id: business_id }).then(function (res) {
if (res.code == 0) {
_this2.companyList = res.data; //商户列表
_this3.companyList = res.data; //商户列表
// 查询一级分类
if (_this2.companyList.length > 0) {
_this2.getCateList(_this2.companyList[0].id);
if (_this3.companyList.length > 0) {
_this3.getCateList(_this3.companyList[0].id);
} else {
_this2.getCateList(0);
_this3.getCateList(0);
}
}
});
},
// 查询一级分类
getCateList: function getCateList(pid) {var _this3 = this;
getCateList: function getCateList(pid) {var _this4 = this;
this.$requst.get('/api/spu/category', { business_id: pid }).then(function (res) {
if (res.code == 0) {
if (res.data.length > 0) {
uni.setStorageSync('companyIndex', _this3.companyIndex); //工厂index
uni.setStorageSync('businessId', _this3.businessId); //工厂id
_this3.cateIndex = 0;
_this3.cateList = [];
_this3.cateList = res.data; //一级分类
uni.setStorageSync('companyIndex', _this4.companyIndex); //工厂index
uni.setStorageSync('businessId', _this4.businessId); //工厂id
_this4.cateIndex = 0;
_this4.cateList = [];
_this4.cateList = res.data; //一级分类
// 查询二级
_this3.getSecondList(_this3.cateIndex);
_this4.getSecondList(_this4.cateIndex);
} else {
_this3.$toolAll.tools.showToast('该商户不能选择');
_this3.companyIndex = uni.getStorageSync('companyIndex'); //还原工厂index
_this3.businessId = uni.getStorageSync('businessId'); //还原工厂id
_this4.$toolAll.tools.showToast('该商户不能选择');
_this4.companyIndex = uni.getStorageSync('companyIndex'); //还原工厂index
_this4.businessId = uni.getStorageSync('businessId'); //还原工厂id
}
}
uni.hideLoading();

View File

@ -262,14 +262,23 @@ var _default = {
geList: function geList(state) {return state.moduleA.geList;} })),
onShow: function onShow() {var _this = this;
this.playTimer = setTimeout(function () {
_this.isplay = true;
}, 2000);
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getHomeData();
_this.getArticleNav();
}
});
} else {
this.getHomeData();
this.getArticleNav();
}
},
onLoad: function onLoad() {
this.getHomeData();
this.getArticleNav();
onShow: function onShow() {var _this2 = this;
this.playTimer = setTimeout(function () {
_this2.isplay = true;
}, 2000);
},
onReady: function onReady() {
@ -292,9 +301,6 @@ var _default = {
if (this.articleList.length < this.total) {
this.page++;
this.getArticleList();
} else {
this.totalAll = this.total;
return false;
}
},
onHide: function onHide() {
@ -303,7 +309,7 @@ var _default = {
},
methods: {
// 获取首页数据
getHomeData: function getHomeData() {var _this2 = this;
getHomeData: function getHomeData() {var _this3 = this;
this.$requst.get('/api/index/home').then(function (res) {
if (res.code == 0) {
var bannerArr = [];
@ -316,15 +322,15 @@ var _default = {
bannerArr.push(obj);
});
_this2.bannerList = bannerArr;
_this2.recommendList = res.data['banner-next-2'];
_this2.productList = res.data.spu;
_this2.ifLoading = false;
_this3.bannerList = bannerArr;
_this3.recommendList = res.data['banner-next-2'];
_this3.productList = res.data.spu;
_this3.ifLoading = false;
}
});
},
// 获取文章栏目
getArticleNav: function getArticleNav() {var _this3 = this;
getArticleNav: function getArticleNav() {var _this4 = this;
this.$requst.get('/api/archives/category').then(function (res) {
if (res.code == 0) {
res.data.forEach(function (item) {
@ -332,11 +338,11 @@ var _default = {
id: item.id,
name: item.title };
_this3.navTabList.push(obj);
_this4.navTabList.push(obj);
});
_this3.articleNavId = _this3.navTabList[0].id;
_this4.articleNavId = _this4.navTabList[0].id;
// 获取文章列表
_this3.getArticleList();
_this4.getArticleList();
}
});
},
@ -352,7 +358,7 @@ var _default = {
}
},
// 获取文章列表
getArticleList: function getArticleList() {var _this4 = this;
getArticleList: function getArticleList() {var _this5 = this;
uni.showLoading();
var params = {
page: this.page,
@ -361,18 +367,21 @@ var _default = {
this.$requst.get('/api/archives/list', params).then(function (res) {
if (res.code == 0) {
_this4.total = res.data.total;
_this5.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
title: item.title,
time: _this4.dateFormat(item.published_at),
time: _this5.dateFormat(item.published_at),
src: item.cover };
newArr.push(obj);
});
_this4.articleList = newArr;
_this5.articleList = newArr;
if (_this5.articleList.length == _this5.total) {
_this5.totalAll = _this5.total;
}
}
uni.hideLoading();
});

View File

@ -242,10 +242,19 @@ var _default = {
footHeight: function footHeight(state) {return state.moduleA.footHeight;} })),
onLoad: function onLoad(op) {
onLoad: function onLoad(op) {var _this = this;
if (op !== '') {
this.id = op.id;
this.getKitDetail(this.id);
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.id = op.id;
_this.getKitDetail(_this.id);
}
});
} else {
this.id = op.id;
this.getKitDetail(this.id);
}
}
},
onShow: function onShow() {
@ -267,12 +276,12 @@ var _default = {
},
methods: {
//查询套件详情
getKitDetail: function getKitDetail(id) {var _this = this;
getKitDetail: function getKitDetail(id) {var _this2 = this;
uni.showLoading();
this.$requst.get('/api/spu/detail', { id: id }).then(function (res) {
if (res.code == 0) {
_this.kitDetail = res.data.detail; //套件详情
_this.kitSku = res.data.sku; //套件规格
_this2.kitDetail = res.data.detail; //套件详情
_this2.kitSku = res.data.sku; //套件规格
var newArr = [];
res.data.detail.images.forEach(function (item) {
var obj = {
@ -280,13 +289,13 @@ var _default = {
newArr.push(obj);
});
_this.kitBanner = newArr; //详情轮播图
_this2.kitBanner = newArr; //详情轮播图
}
uni.hideLoading();
});
},
//收藏
collectionEv: function collectionEv(id) {var _this2 = this;
collectionEv: function collectionEv(id) {var _this3 = this;
var params = {
id: id,
action: this.action };
@ -295,34 +304,34 @@ var _default = {
this.$requst.post('/api/spu/un-record', params).then(function (res) {
if (res.code == 0) {
// this.$toolAll.tools.showToast('取消收藏成功');
_this2.getKitDetail(_this2.id);
_this3.getKitDetail(_this3.id);
}
});
} else {
this.$requst.post('/api/spu/record', params).then(function (res) {
if (res.code == 0) {
// this.$toolAll.tools.showToast('收藏成功');
_this2.getKitDetail(_this2.id);
_this3.getKitDetail(_this3.id);
}
});
}
},
// 加入购物车
joinCart: function joinCart() {var _this3 = this;
joinCart: function joinCart() {var _this4 = this;
if (this.$toolAll.tools.judgeAuth()) {
this.$requst.post('/api/order/shopping-cart-add', { sku_id: this.kitSku[this.kitIndex].id, num: 1 }).then(function (res) {
if (res.code == 0) {
_this3.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
_this4.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
(0, _publicApi.getCartNum)();
} else {
_this3.$toolAll.tools.showToast(res.msg);
_this4.$toolAll.tools.showToast(res.msg);
}
});
}
},
// 立即购买
buyNow: function buyNow() {var _this4 = this;
buyNow: function buyNow() {var _this5 = this;
if (this.$toolAll.tools.judgeAuth()) {
this.$requst.post('/api/order/shopping-cart-add', { sku_id: this.kitSku[this.kitIndex].id, num: 1 }).then(function (res) {
if (res.code == 0) {
@ -330,7 +339,7 @@ var _default = {
url: "/pagesA/cart/cart" });
} else {
_this4.$toolAll.tools.showToast(res.msg);
_this5.$toolAll.tools.showToast(res.msg);
}
});
}

View File

@ -1 +1 @@
<view class="pad-b140"><status-nav vue-id="6c2aabf4-1" ifReturn="{{true}}" navBarTitle="套件简介" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="shop-img"><swiper-pu vue-id="6c2aabf4-2" newRadius="0" bannerList="{{kitBanner}}" newHeight="505rpx" newBottom="35rpx" isplay="{{isplay}}" bind:__l="__l"></swiper-pu></view><view class="shop-summary kit-summary"><view class="shop-title">{{kitDetail.name}}</view><view class="shop-txt flex"><view class="left"><view class="shop-customized">{{kitDetail.customized==1?'可定制':'不可定制'}}</view><view class="kit-compose">{{kitDetail.subtitle}}</view><view class="shop-pric">{{"¥"+kitDetail.price}}</view></view><view class="right flex"><view data-event-opts="{{[['tap',[['collectionEv',['$0'],['kitDetail.id']]]]]}}" class="{{['collection-btn','flex',kitDetail.is_collected==1?'active':'']}}" bindtap="__e"><image src="/static/public/icon-collection.png" mode="widthFix"></image><text>收藏</text></view><view class="share-btn flex"><image src="/static/public/icon-share.png" mode="widthFix"></image><text>分享</text><button plain="true" data-name="shareBtn" open-type="share"></button></view></view></view></view><view class="kit-contain"><view class="contain-h2">套件包含</view><view class="contain-list flex"><block wx:for="{{kitDetail.series}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['kitDetail.series','',index,'id']]]]]]]}}" class="contain-item" bindtap="__e"><view class="contain-img"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="contain-title clips2">{{item.name}}</view></view></block></view></view><view class="shop-btns flex"><view data-event-opts="{{[['tap',[['joinCart',['$0'],['specsIndex']]]]]}}" class="btn" bindtap="__e">加入购物车</view><view data-event-opts="{{[['tap',[['buyNow',['$0'],['specsIndex']]]]]}}" class="btn" bindtap="__e">立即购买</view></view><enter-cart vue-id="6c2aabf4-3" bottom="{{335}}" bind:__l="__l"></enter-cart><customer-service vue-id="6c2aabf4-4" bind:__l="__l"></customer-service></view>
<view class="pad-b140"><status-nav vue-id="6c2aabf4-1" ifReturn="{{true}}" navBarTitle="套件简介" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="shop-img"><swiper-pu vue-id="6c2aabf4-2" newRadius="0" bannerList="{{kitBanner}}" newHeight="505rpx" newBottom="35rpx" isplay="{{isplay}}" bind:__l="__l"></swiper-pu></view><view class="shop-summary kit-summary"><view class="shop-title">{{kitDetail.name}}</view><view class="shop-txt flex"><view class="left"><view class="kit-compose">{{kitDetail.subtitle}}</view><view class="shop-customized">{{kitDetail.customized==1?'可定制':'不可定制'}}</view><view class="shop-pric">{{"¥"+kitDetail.price}}</view></view><view class="right flex"><view data-event-opts="{{[['tap',[['collectionEv',['$0'],['kitDetail.id']]]]]}}" class="{{['collection-btn','flex',kitDetail.is_collected==1?'active':'']}}" bindtap="__e"><image src="/static/public/icon-collection.png" mode="widthFix"></image><text>收藏</text></view><view class="share-btn flex"><image src="/static/public/icon-share.png" mode="widthFix"></image><text>分享</text><button plain="true" data-name="shareBtn" open-type="share"></button></view></view></view></view><view class="kit-contain"><view class="contain-h2">套件包含</view><view class="contain-list flex"><block wx:for="{{kitDetail.series}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['kitDetail.series','',index,'id']]]]]]]}}" class="contain-item" bindtap="__e"><view class="contain-img"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="contain-title clips2">{{item.name}}</view></view></block></view></view><view class="shop-btns flex"><view data-event-opts="{{[['tap',[['joinCart',['$0'],['specsIndex']]]]]}}" class="btn" bindtap="__e">加入购物车</view><view data-event-opts="{{[['tap',[['buyNow',['$0'],['specsIndex']]]]]}}" class="btn" bindtap="__e">立即购买</view></view><enter-cart vue-id="6c2aabf4-3" bottom="{{335}}" bind:__l="__l"></enter-cart><customer-service vue-id="6c2aabf4-4" bind:__l="__l"></customer-service></view>

View File

@ -191,6 +191,8 @@ __webpack_require__.r(__webpack_exports__);
@ -220,16 +222,22 @@ var _default = {
footHeight: function footHeight(state) {return state.moduleA.footHeight;} })),
onLoad: function onLoad(op) {
this.getKitEv();
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getKitEv();
}
});
} else {
this.getKitEv();
}
},
onReachBottom: function onReachBottom(e) {
if (this.kitList.length < this.total) {
this.page++;
//查询套件列表
this.getKitEv();
} else {
this.totalAll = this.total;
}
},
// 分享到微信
@ -248,7 +256,7 @@ var _default = {
},
methods: {
// 查询套件列表
getKitEv: function getKitEv() {var _this = this;
getKitEv: function getKitEv() {var _this2 = this;
uni.showLoading();
var params = {
page: this.page,
@ -258,8 +266,7 @@ var _default = {
this.$requst.post('/api/spu/series', params).then(function (res) {
if (res.code == 0) {
_this.total = res.data.total;
console.log(res, '套件列表');
_this2.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
@ -270,7 +277,10 @@ var _default = {
newArr.push(obj);
});
_this.kitList = newArr;
_this2.kitList = newArr;
if (_this2.kitList.length == _this2.total) {
_this2.totalAll = _this2.total;
}
}
uni.hideLoading();
});

View File

@ -1 +1 @@
<view class="pad-b150"><status-nav vue-id="2b600381-1" ifReturn="{{false}}" navBarTitle="套件" marginBottom="{{20}}" bind:__l="__l"></status-nav><view class="kit-list"><block wx:for="{{kitList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['kitList','',index,'id']]]]]]]}}" class="kit-item" catchtap="__e"><view class="kit-title">{{item.name}}</view><view class="kit-compose"><block wx:for="{{item.series}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><text>{{item1.name+"+"}}</text></block><text>组合</text></view><view class="kit-img"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="compose-list-bg"><block wx:if="{{item.series.length>0}}"><view class="compose-list flex" style="{{'width:'+(item.series.length*270-22+'rpx')+';'}}"><block wx:for="{{item.series}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view class="compose-item"><view class="compose-img"><image src="{{item2.cover}}" mode="widthFix"></image></view><view class="compose-title clips1">{{item2.name}}</view></view></block></view></block></view></view></block></view><enter-cart vue-id="2b600381-2" bind:__l="__l"></enter-cart><foot-tab vue-id="2b600381-3" current="2" bind:__l="__l"></foot-tab></view>
<view class="pad-b150"><status-nav vue-id="2b600381-1" ifReturn="{{false}}" navBarTitle="套件" marginBottom="{{20}}" bind:__l="__l"></status-nav><view class="kit-list"><block wx:for="{{kitList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['kitList','',index,'id']]]]]]]}}" class="kit-item" catchtap="__e"><view class="kit-title">{{item.name}}</view><view class="kit-compose"><block wx:for="{{item.series}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><text>{{item1.name+"+"}}</text></block><text>组合</text></view><view class="kit-img"><image src="{{item.cover}}" mode="widthFix"></image></view><view class="compose-list-bg"><block wx:if="{{item.series.length>0}}"><view class="compose-list flex" style="{{'width:'+(item.series.length*270-22+'rpx')+';'}}"><block wx:for="{{item.series}}" wx:for-item="item2" wx:for-index="index2" wx:key="index2"><view class="compose-item"><view class="compose-img"><image src="{{item2.cover}}" mode="widthFix"></image></view><view class="compose-title clips1">{{item2.name}}</view></view></block></view></block></view></view></block></view><block wx:if="{{totalAll==total}}"><view class="more-txt">暂无更多内容</view></block><enter-cart vue-id="2b600381-2" bind:__l="__l"></enter-cart><foot-tab vue-id="2b600381-3" current="2" bind:__l="__l"></foot-tab></view>

View File

@ -309,39 +309,49 @@ __webpack_require__.r(__webpack_exports__);
onHide: function onHide() {
},
onLoad: function onLoad() {
this.getUserInfo();
this.getCustomer();
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getUserInfo();
_this.getCustomer();
}
});
} else {
this.getUserInfo();
this.getCustomer();
}
},
onShow: function onShow() {
},
methods: {
// 获取用户信息
getUserInfo: function getUserInfo() {var _this = this;
getUserInfo: function getUserInfo() {var _this2 = this;
uni.showLoading();
this.$requst.get('/api/user/info').then(function (res) {
console.log(res, '用户信息');
if (res.code == 0) {
uni.setStorageSync('business_id', res.data.business_id);
var newArr = res.data.order_count;
_this.headPortrait = res.data.headimgurl,
_this.nickName = res.data.nickname;
_this.businessCode = res.data.business_code;
_this.myOrder[0].num = newArr.all,
_this.myOrder[1].num = newArr.ordered,
_this.myOrder[2].num = newArr.completed,
_this.myOrder[3].num = newArr.closed;
_this2.headPortrait = res.data.headimgurl,
_this2.nickName = res.data.nickname;
_this2.businessCode = res.data.business_code;
_this2.myOrder[0].num = newArr.all,
_this2.myOrder[1].num = newArr.ordered,
_this2.myOrder[2].num = newArr.completed,
_this2.myOrder[3].num = newArr.closed;
}
uni.hideLoading();
});
},
// 获取商家客服
getCustomer: function getCustomer() {var _this2 = this;
getCustomer: function getCustomer() {var _this3 = this;
this.$requst.post('/api/user/business-qr').then(function (res) {
console.log(res, '商家客服');
if (res.code == 0) {
_this2.customerSrc = res.data.qr;
_this3.customerSrc = res.data.qr;
}
});
},
@ -386,7 +396,7 @@ __webpack_require__.r(__webpack_exports__);
}
},
// 提交会员申请
submitEv: function submitEv() {var _this3 = this;
submitEv: function submitEv() {var _this4 = this;
if (this.checkEmpty() && this.flag) {
this.flag = false;
var params = {
@ -397,11 +407,11 @@ __webpack_require__.r(__webpack_exports__);
this.$requst.post('/api/user/vip', params).then(function (res) {
if (res.code == 0) {
_this3.closeEv(); //关闭会员申请
_this3.getUserInfo(); // 刷新信息
_this4.closeEv(); //关闭会员申请
_this4.getUserInfo(); // 刷新信息
} else {
_this3.$toolAll.tools.showToast(res.msg);
_this3.flag = true;
_this4.$toolAll.tools.showToast(res.msg);
_this4.flag = true;
}
});
}
@ -431,14 +441,14 @@ __webpack_require__.r(__webpack_exports__);
},
// 验证会员码
checkCode: function checkCode() {var _this4 = this;
checkCode: function checkCode() {var _this5 = this;
if (this.vipCode !== '') {
this.$requst.post('/api/user/check-code', { code: this.vipCode }).then(function (res) {
if (res.code == 0) {
_this4.$toolAll.tools.showToast('验证成功');
_this4.closeCheck(); //清除验证信息
_this5.$toolAll.tools.showToast('验证成功');
_this5.closeCheck(); //清除验证信息
} else {
_this4.$toolAll.tools.showToast(res.msg);
_this5.$toolAll.tools.showToast(res.msg);
}
});
} else {

View File

@ -207,11 +207,19 @@ var _default = {
footHeight: function footHeight(state) {return state.moduleA.footHeight;} })),
onLoad: function onLoad() {
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getCollectionList();
}
});
} else {
this.getCollectionList();
}
},
onReady: function onReady() {
this.getCollectionList();
},
onReachBottom: function onReachBottom(e) {
if (this.collectionList.length < this.total) {
@ -254,7 +262,7 @@ var _default = {
}
},
// 获取收藏列表
getCollectionList: function getCollectionList() {var _this = this;
getCollectionList: function getCollectionList() {var _this2 = this;
var params = {
page: this.page,
size: this.size };
@ -263,7 +271,7 @@ var _default = {
uni.showLoading();
this.$requst.get('/api/spu/collection', params).then(function (res) {
if (res.code == 0) {
_this.total = res.data.total;
_this2.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
@ -274,7 +282,7 @@ var _default = {
newArr.push(obj);
});
_this.collectionList = newArr;
_this2.collectionList = newArr;
}
uni.hideLoading();
});
@ -282,18 +290,18 @@ var _default = {
if (this.currentIndex == 1) {
this.$requst.get('/api/archives/collects', params).then(function (res) {
if (res.code == 0) {
_this.total = res.data.total;
_this2.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
src: item.cover,
title: item.title,
time: _this.dateFormat(item.published_at) };
time: _this2.dateFormat(item.published_at) };
newArr.push(obj);
});
_this.collectionList = newArr;
_this2.collectionList = newArr;
}
});
}
@ -310,7 +318,7 @@ var _default = {
return time;
},
//收藏
collectionEv: function collectionEv(id) {var _this2 = this;
collectionEv: function collectionEv(id) {var _this3 = this;
console.log(id, 12121);
if (this.currentIndex == 0) {
var params = {
@ -319,8 +327,8 @@ var _default = {
this.$requst.post('/api/spu/un-record', params).then(function (res) {
if (res.code == 0) {
_this2.$toolAll.tools.showToast('取消收藏成功');
_this2.getCollectionList();
_this3.$toolAll.tools.showToast('取消收藏成功');
_this3.getCollectionList();
}
});
}
@ -331,8 +339,8 @@ var _default = {
this.$requst.post('/api/archives/un-record', _params).then(function (res) {
if (res.code == 0) {
_this2.$toolAll.tools.showToast('取消收藏成功');
_this2.getCollectionList();
_this3.$toolAll.tools.showToast('取消收藏成功');
_this3.getCollectionList();
}
});
}

View File

@ -196,9 +196,17 @@ var _default = {
computed: {},
onLoad: function onLoad(op) {
onLoad: function onLoad(op) {var _this = this;
this.id = op.id;
this.getDetail(this.id);
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getDetail(_this.id);
}
});
} else {
this.getDetail(this.id);
}
},
onShow: function onShow() {
// getNewsDetail()
@ -245,14 +253,14 @@ var _default = {
},
// 查询文章详情
getDetail: function getDetail(id) {var _this = this;
getDetail: function getDetail(id) {var _this2 = this;
uni.showLoading();
this.$requst.post('/api/archives/detail', { id: id }).then(function (res) {
if (res.code == 0) {
console.log(res, '文章详情');
_this.articleDetail = res.data;
_this.time = _this.dateFormat(res.data.published_at);
_this.content = _this.$toolAll.tools.escape2Html(res.data.content);
_this2.articleDetail = res.data;
_this2.time = _this2.dateFormat(res.data.published_at);
_this2.content = _this2.$toolAll.tools.escape2Html(res.data.content);
}
uni.hideLoading();
});
@ -269,7 +277,7 @@ var _default = {
return time;
} }, "collectionEv", function collectionEv(
id) {var _this2 = this;
id) {var _this3 = this;
var params = {
archive_id: id,
action: this.action };
@ -278,14 +286,14 @@ var _default = {
this.$requst.post('/api/archives/un-record', params).then(function (res) {
if (res.code == 0) {
// this.$toolAll.tools.showToast('取消收藏成功');
_this2.getDetail(_this2.id);
_this3.getDetail(_this3.id);
}
});
} else {
this.$requst.post('/api/archives/record', params).then(function (res) {
if (res.code == 0) {
// this.$toolAll.tools.showToast('收藏成功');
_this2.getDetail(_this2.id);
_this3.getDetail(_this3.id);
}
});
}

View File

@ -216,16 +216,21 @@ var _default = {
footHeight: function footHeight(state) {return state.moduleA.footHeight;} })),
onLoad: function onLoad() {
this.getArticleNav();
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getArticleNav();
}
});
} else {
this.getArticleNav();
}
},
onReachBottom: function onReachBottom(e) {
if (this.articleList.length < this.total) {
this.page++;
this.getArticleList();
} else {
this.totalAll = this.total;
return false;
}
},
// 分享到微信
@ -244,7 +249,7 @@ var _default = {
},
methods: {
// 获取文章栏目
getArticleNav: function getArticleNav() {var _this = this;
getArticleNav: function getArticleNav() {var _this2 = this;
this.$requst.get('/api/archives/category').then(function (res) {
if (res.code == 0) {
res.data.forEach(function (item) {
@ -252,17 +257,16 @@ var _default = {
id: item.id,
name: item.title };
_this.navTabList.push(obj);
_this2.navTabList.push(obj);
});
_this.articleNavId = _this.navTabList[0].id;
_this2.articleNavId = _this2.navTabList[0].id;
// 获取文章列表
_this.getArticleList();
_this2.getArticleList();
}
});
},
// 切换事件
chooseEv: function chooseEv(index, id) {
console.log(index, id, 1212121);
if (this.currentIndex !== index) {
this.articleList = [];
this.page = 1;
@ -273,7 +277,7 @@ var _default = {
}
},
// 获取疑难解答、行业资讯列表
getArticleList: function getArticleList() {var _this2 = this;
getArticleList: function getArticleList() {var _this3 = this;
uni.showLoading();
var params = {
page: this.page,
@ -282,18 +286,21 @@ var _default = {
this.$requst.get('/api/archives/list', params).then(function (res) {
if (res.code == 0) {
_this2.total = res.data.total;
_this3.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
title: item.title,
time: _this2.dateFormat(item.published_at),
time: _this3.dateFormat(item.published_at),
src: item.cover };
newArr.push(obj);
});
_this2.articleList = newArr;
_this3.articleList = newArr;
if (_this3.articleList.length == _this3.total) {
_this3.totalAll = _this3.total;
}
}
uni.hideLoading();
});

View File

@ -93,6 +93,29 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
var components
try {
components = {
customerService: function() {
return __webpack_require__.e(/*! import() | components/customer-service/customer-service */ "components/customer-service/customer-service").then(__webpack_require__.bind(null, /*! @/components/customer-service/customer-service.vue */ 206))
}
}
} catch (e) {
if (
e.message.indexOf("Cannot find module") !== -1 &&
e.message.indexOf(".vue") !== -1
) {
console.error(e.message)
console.error("1. 排查组件名称拼写是否正确")
console.error(
"2. 排查组件是否符合 easycom 规范文档https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
)
console.error(
"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件"
)
} else {
throw e
}
}
var render = function() {
var _vm = this
var _h = _vm.$createElement
@ -130,7 +153,10 @@ __webpack_require__.r(__webpack_exports__);
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var statusNav = function statusNav() {__webpack_require__.e(/*! require.ensure | components/status-navs/status-nav */ "components/status-navs/status-nav").then((function () {return resolve(__webpack_require__(/*! @/components/status-navs/status-nav */ 192));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var _default =
/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var statusNav = function statusNav() {__webpack_require__.e(/*! require.ensure | components/status-navs/status-nav */ "components/status-navs/status-nav").then((function () {return resolve(__webpack_require__(/*! @/components/status-navs/status-nav */ 192));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var customerService = function customerService() {__webpack_require__.e(/*! require.ensure | components/customer-service/customer-service */ "components/customer-service/customer-service").then((function () {return resolve(__webpack_require__(/*! @/components/customer-service/customer-service.vue */ 206));}).bind(null, __webpack_require__)).catch(__webpack_require__.oe);};var _default =
@ -154,7 +180,8 @@ __webpack_require__.r(__webpack_exports__);
{
components: {
statusNav: statusNav },
statusNav: statusNav,
customerService: customerService },
data: function data() {
return {
@ -163,7 +190,6 @@ __webpack_require__.r(__webpack_exports__);
};
},
onLoad: function onLoad(op) {var _this = this;
console.log(op, '传值');
this.orderCode = op.coding;
this.$requst.get('/api/user/business-qr', { id: op.id }).then(function (res) {
if (res.code == 0) {

View File

@ -2,6 +2,7 @@
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"usingComponents": {
"customer-service": "/components/customer-service/customer-service",
"status-nav": "/components/status-navs/status-nav"
}
}

View File

@ -1 +1 @@
<view><status-nav vue-id="31263268-1" ifReturn="{{false}}" navBarTitle="完成" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="finish-content"><view class="finish-img"><image src="{{imgsrc}}" mode="widthFix"></image></view><view class="finish-code">{{"订单:"+orderCode}}</view><view class="finish-title">已完成提交</view><view class="finish-tips"><view>请扫描二维码添加微信告知您的订单</view><view>号并支付定金 ,发货前请支付尾款。</view></view><view data-event-opts="{{[['tap',[['saveImg',['$event']]]]]}}" class="cope-btn" bindtap="__e">保存二维码</view><view data-event-opts="{{[['tap',[['goShop',['$event']]]]]}}" class="shoping-btn" bindtap="__e">继续购物</view></view></view>
<view><status-nav vue-id="31263268-1" ifReturn="{{false}}" navBarTitle="完成" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="finish-content"><view class="finish-img"><image src="{{imgsrc}}" mode="widthFix"></image></view><view class="finish-code">{{"订单:"+orderCode}}</view><view class="finish-title">已完成提交</view><view class="finish-tips"><view>请扫描二维码添加微信告知您的订单</view><view>号并支付定金 ,发货前请支付尾款。</view></view><view data-event-opts="{{[['tap',[['saveImg',['$event']]]]]}}" class="cope-btn" bindtap="__e">保存二维码</view><view data-event-opts="{{[['tap',[['goShop',['$event']]]]]}}" class="shoping-btn" bindtap="__e">继续购物</view></view><customer-service vue-id="31263268-2" bind:__l="__l"></customer-service></view>

View File

@ -0,0 +1,40 @@
.customer-service-bg{
position: fixed;
width: 120rpx;
height: 120rpx;
background-color: #FFFFFF;
border-radius: 100%;
box-shadow: 0 0 16rpx rgba(0,0,0,.4);
-webkit-animation: scale_name 1s linear alternate infinite;
animation: scale_name 1s linear alternate infinite;
overflow: hidden;
}
.customer-service{
justify-content: center;
align-items: center;
position: relative;
width: 100%;
height: 100%;
}
.customer-service image{
width: 68rpx;
height: 68rpx;
}
.customer-service .service-btn{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
opacity: 0;
}
@-webkit-keyframes scale_name{
from{-webkit-transform: scale(1);transform: scale(1);}
to{-webkit-transform: scale(1.1);transform: scale(1.1);}
}
@keyframes scale_name{
from{-webkit-transform: scale(1);transform: scale(1);}
to{-webkit-transform: scale(1.1);transform: scale(1.1);}
}

View File

@ -191,26 +191,34 @@ __webpack_require__.r(__webpack_exports__);
flag: true };
},
onLoad: function onLoad() {
console.log(uni.getStorageSync('buyList'), '缓存数组');
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getUserInfo();
}
});
} else {
this.getUserInfo();
}
},
onShow: function onShow() {
this.getUserInfo();
},
methods: {
// 获取默认信息
getUserInfo: function getUserInfo() {var _this = this;
getUserInfo: function getUserInfo() {var _this2 = this;
this.$requst.get('/api/user/info').then(function (res) {
console.log(res, '用户信息');
if (res.code == 0) {
_this.address = res.data.order_address; //地址
_this.name = res.data.order_contact; //联系人
_this.phone = res.data.order_phone; //电话
_this2.address = res.data.order_address; //地址
_this2.name = res.data.order_contact; //联系人
_this2.phone = res.data.order_phone; //电话
}
});
},
// 提交
submit: function submit() {var _this2 = this;
submit: function submit() {var _this3 = this;
if (this.checkEmpty() && this.flag) {
this.flag = false;
var params = {
@ -227,8 +235,8 @@ __webpack_require__.r(__webpack_exports__);
} else {
console.log(res.msg, '提示信息');
_this2.$toolAll.tools.showToast(res.msg);
_this2.flag = true;
_this3.$toolAll.tools.showToast(res.msg);
_this3.flag = true;
}
});
}
@ -241,6 +249,8 @@ __webpack_require__.r(__webpack_exports__);
this.$toolAll.tools.showToast('请正确填写联系电话');
} else if (!this.address) {
this.$toolAll.tools.showToast('请填写收货地址');
} else if (!this.toTime) {
this.$toolAll.tools.showToast('请选择送货时间');
} else {
result = true;
}

View File

@ -255,11 +255,19 @@ __webpack_require__.r(__webpack_exports__);
id: 0 //订单id
};
},
onLoad: function onLoad(op) {
onLoad: function onLoad(op) {var _this = this;
if (op.id !== '') {
this.id = op.id;
}
this.getOrderDetail();
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getOrderDetail();
}
});
} else {
this.getOrderDetail();
}
},
// 分享到微信
onShareAppMessage: function onShareAppMessage() {
@ -277,11 +285,11 @@ __webpack_require__.r(__webpack_exports__);
},
methods: {
// 查询订单详情
getOrderDetail: function getOrderDetail() {var _this = this;
getOrderDetail: function getOrderDetail() {var _this2 = this;
uni.showLoading();
this.$requst.get('/api/user/order-detail', { id: this.id }).then(function (res) {
if (res.code == 0) {
_this.orderDetail = res.data;
_this2.orderDetail = res.data;
}
uni.hideLoading();
});
@ -289,18 +297,18 @@ __webpack_require__.r(__webpack_exports__);
// 取消订单
cancleEv: function cancleEv() {var _this2 = this;
cancleEv: function cancleEv() {var _this3 = this;
var params = {
order_coding: this.orderDetail.coding //订单号
};
this.$requst.post('/api/order/cancel', params).then(function (res) {
if (res.code == 0) {
_this2.$toolAll.tools.showToast('取消订单成功(*^▽^*)');
_this3.$toolAll.tools.showToast('取消订单成功(*^▽^*)');
uni.navigateTo({
url: '/pagesA/order/order' });
} else {
_this2.$toolAll.tools.showToast(res.msg);
_this3.$toolAll.tools.showToast(res.msg);
}
});
},

View File

@ -197,6 +197,8 @@ __webpack_require__.r(__webpack_exports__);
@ -218,28 +220,33 @@ __webpack_require__.r(__webpack_exports__);
flag: true,
ifLoading: false,
total: 0,
totalAll: 0,
totalAll: -1,
page: 1,
size: 10,
tag: 'all' };
},
onLoad: function onLoad(op) {
onLoad: function onLoad(op) {var _this = this;
if (op.tag !== '') {
this.tag = op.tag;
}
if (op.index !== '') {
this.activeIndex = op.index;
}
this.getOrderList();
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getOrderList();
}
});
} else {
this.getOrderList();
}
},
onReachBottom: function onReachBottom(e) {
if (this.orderList.length < this.total) {
this.page++;
this.getOrderList();
} else {
this.totalAll = this.total;
return false;
}
},
// 分享到微信
@ -266,7 +273,7 @@ __webpack_require__.r(__webpack_exports__);
this.getOrderList();
},
// 获取订单列表
getOrderList: function getOrderList() {var _this = this;
getOrderList: function getOrderList() {var _this2 = this;
uni.showLoading();
var params = {
page: this.page,
@ -275,7 +282,8 @@ __webpack_require__.r(__webpack_exports__);
this.$requst.get('/api/user/order', params).then(function (res) {
if (res.data.length != 0) {
_this.total = res.data.total;
_this2.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id, //id
@ -285,9 +293,12 @@ __webpack_require__.r(__webpack_exports__);
status_text: item.status_text, //订单状态中文
skus: item.skus //订单详情
};
_this.orderList.push(obj);
newArr.push(obj);
});
// console.log(this.orderList,'订单列表')
_this2.orderList = newArr;
if (_this2.orderList.length == _this2.total) {
_this2.totalAll = _this2.total;
}
}
uni.hideLoading();
});
@ -299,34 +310,34 @@ __webpack_require__.r(__webpack_exports__);
},
// 取消订单
cancleEv: function cancleEv(coding) {var _this2 = this;
cancleEv: function cancleEv(coding) {var _this3 = this;
var params = {
order_coding: coding //订单号
};
this.$requst.post('/api/order/cancel', params).then(function (res) {
if (res.code == 0) {
_this2.$toolAll.tools.showToast('取消订单成功(*^▽^*)');
_this2.orderList = [];
_this2.page = 1;
_this2.getOrderList();
_this3.$toolAll.tools.showToast('取消订单成功(*^▽^*)');
_this3.orderList = [];
_this3.page = 1;
_this3.getOrderList();
} else {
_this2.$toolAll.tools.showToast(res.msg);
_this3.$toolAll.tools.showToast(res.msg);
}
});
},
// 确认收货
affirmEv: function affirmEv(id) {var _this3 = this;
affirmEv: function affirmEv(id) {var _this4 = this;
var params = {
order_id: id //订单号
};
this.$requst.post('/api/order/accepted', params).then(function (res) {
if (res.code == 0) {
_this3.$toolAll.tools.showToast('确认收货成功(*^▽^*)');
_this3.dataList = [];
_this3.page = 1;
_this3.getOrderList();
_this4.$toolAll.tools.showToast('确认收货成功(*^▽^*)');
_this4.dataList = [];
_this4.page = 1;
_this4.getOrderList();
} else {
_this3.$toolAll.tools.showToast(res.msg);
_this4.$toolAll.tools.showToast(res.msg);
}
});
},

View File

@ -1 +1 @@
<view class="data-v-0d5a9fc9"><status-nav vue-id="c40c4b46-1" ifReturn="{{true}}" navBarTitle="订单管理" marginBottom="{{0}}" class="data-v-0d5a9fc9" bind:__l="__l"></status-nav><view class="order-nav flex data-v-0d5a9fc9" style="{{'top:'+(newTop+'px')+';'}}"><block wx:for="{{orderNav}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['changeNav',[index,'$0'],[[['orderNav','',index,'tag']]]]]]]}}" class="{{['item','data-v-0d5a9fc9',activeIndex==index?'cur':'']}}" bindtap="__e">{{item.title}}</view></block></view><view class="order-list data-v-0d5a9fc9"><block wx:for="{{$root.l1}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['orderList','',index,'id']]]]]]]}}" class="order-item data-v-0d5a9fc9" catchtap="__e"><view class="order-code flex data-v-0d5a9fc9"><text class="data-v-0d5a9fc9">{{"订单号:"+item.$orig.coding}}</text><text class="status data-v-0d5a9fc9">{{item.$orig.status_text}}</text></view><view class="item-bg data-v-0d5a9fc9"><block wx:for="{{item.l0}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="item flex data-v-0d5a9fc9"><view class="img data-v-0d5a9fc9"><image src="{{item1.$orig.spu_cover}}" mode="widthFix" class="data-v-0d5a9fc9"></image></view><view class="txt data-v-0d5a9fc9"><view class="title data-v-0d5a9fc9">{{item1.$orig.spu_name}}</view><view class="specs clips2 data-v-0d5a9fc9">{{"规格:"+item1.$orig.custom_title}}</view><view class="price flex data-v-0d5a9fc9"><text class="data-v-0d5a9fc9">{{"¥"+item1.g0}}</text><view class="data-v-0d5a9fc9"><text class="data-v-0d5a9fc9">x</text>{{item1.$orig.num}}</view></view></view></view></block></view><view class="total-price flex data-v-0d5a9fc9"><text class="data-v-0d5a9fc9">{{"合计:¥"+item.g1}}</text><block wx:if="{{item.$orig.status=='ordered'}}"><view data-event-opts="{{[['tap',[['cancleEv',['$0'],[[['orderList','',index,'coding']]]]]]]}}" class="btn data-v-0d5a9fc9" catchtap="__e">取消订单</view></block><block wx:if="{{item.$orig.status=='completed'||item.$orig.status=='closed'}}"><view data-event-opts="{{[['tap',[['buyAgain',[index]]]]]}}" class="btn cur data-v-0d5a9fc9" catchtap="__e">再次购买</view></block></view></view></block></view><block wx:if="{{totalAll==total}}"><view class="data-v-0d5a9fc9"><pitera vue-id="c40c4b46-2" textStr="—— 到底啦 ——" class="data-v-0d5a9fc9" bind:__l="__l"></pitera></view></block><block wx:if="{{!ifLoading&&!orderList.length}}"><nothing-page vue-id="c40c4b46-3" content="还没有相关订单哟(*^▽^*)" class="data-v-0d5a9fc9" bind:__l="__l"></nothing-page></block></view>
<view class="data-v-0d5a9fc9"><status-nav vue-id="c40c4b46-1" ifReturn="{{true}}" navBarTitle="订单管理" marginBottom="{{0}}" class="data-v-0d5a9fc9" bind:__l="__l"></status-nav><view class="order-nav flex data-v-0d5a9fc9" style="{{'top:'+(newTop+'px')+';'}}"><block wx:for="{{orderNav}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['changeNav',[index,'$0'],[[['orderNav','',index,'tag']]]]]]]}}" class="{{['item','data-v-0d5a9fc9',activeIndex==index?'cur':'']}}" bindtap="__e">{{item.title}}</view></block></view><view class="order-list data-v-0d5a9fc9"><block wx:for="{{$root.l1}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['toDetail',['$0'],[[['orderList','',index,'id']]]]]]]}}" class="order-item data-v-0d5a9fc9" catchtap="__e"><view class="order-code flex data-v-0d5a9fc9"><text class="data-v-0d5a9fc9">{{"订单号:"+item.$orig.coding}}</text><text class="status data-v-0d5a9fc9">{{item.$orig.status_text}}</text></view><view class="item-bg data-v-0d5a9fc9"><block wx:for="{{item.l0}}" wx:for-item="item1" wx:for-index="index1" wx:key="index1"><view class="item flex data-v-0d5a9fc9"><view class="img data-v-0d5a9fc9"><image src="{{item1.$orig.spu_cover}}" mode="widthFix" class="data-v-0d5a9fc9"></image></view><view class="txt data-v-0d5a9fc9"><view class="title data-v-0d5a9fc9">{{item1.$orig.spu_name}}</view><view class="specs clips2 data-v-0d5a9fc9">{{"规格:"+item1.$orig.custom_title}}</view><view class="price flex data-v-0d5a9fc9"><text class="data-v-0d5a9fc9">{{"¥"+item1.g0}}</text><view class="data-v-0d5a9fc9"><text class="data-v-0d5a9fc9">x</text>{{item1.$orig.num}}</view></view></view></view></block></view><view class="total-price flex data-v-0d5a9fc9"><text class="data-v-0d5a9fc9">{{"合计:¥"+item.g1}}</text><block wx:if="{{item.$orig.status=='ordered'}}"><view data-event-opts="{{[['tap',[['cancleEv',['$0'],[[['orderList','',index,'coding']]]]]]]}}" class="btn data-v-0d5a9fc9" catchtap="__e">取消订单</view></block><block wx:if="{{item.$orig.status=='completed'||item.$orig.status=='closed'}}"><view data-event-opts="{{[['tap',[['buyAgain',[index]]]]]}}" class="btn cur data-v-0d5a9fc9" catchtap="__e">再次购买</view></block></view></view></block></view><block wx:if="{{totalAll==total}}"><view class="more-txt data-v-0d5a9fc9" style="padding-bottom:40rpx;">—— 到底啦 ——</view></block><block wx:if="{{!ifLoading&&!orderList.length}}"><nothing-page vue-id="c40c4b46-2" content="还没有相关订单哟(*^▽^*)" class="data-v-0d5a9fc9" bind:__l="__l"></nothing-page></block></view>

View File

@ -272,11 +272,19 @@ var _default = {
footHeight: function footHeight(state) {return state.moduleA.footHeight;} })),
onLoad: function onLoad(op) {
onLoad: function onLoad(op) {var _this = this;
if (op !== '') {
this.source = op.source;
this.id = op.id;
this.getDetail(this.id);
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getDetail(_this.id);
}
});
} else {
this.getDetail(this.id);
}
}
},
onShow: function onShow() {
@ -322,13 +330,13 @@ var _default = {
this.isShow = false;
},
//查询商品详情
getDetail: function getDetail(id) {var _this = this;
getDetail: function getDetail(id) {var _this2 = this;
uni.showLoading();
this.$requst.get('/api/spu/detail', { id: id }).then(function (res) {
if (res.code == 0) {
console.log(res, '详情');
_this.shopDetail = res.data.detail; //详情数据
_this.shopSku = res.data.sku;
_this2.shopDetail = res.data.detail; //详情数据
_this2.shopSku = res.data.sku;
var newArr = [];
res.data.detail.images.forEach(function (item) {
var obj = {
@ -336,13 +344,13 @@ var _default = {
newArr.push(obj);
});
_this.shopBanner = newArr; //详情轮播图
_this2.shopBanner = newArr; //详情轮播图
}
uni.hideLoading();
});
},
//收藏
collectionEv: function collectionEv(id) {var _this2 = this;
collectionEv: function collectionEv(id) {var _this3 = this;
var params = {
id: id,
action: this.action };
@ -351,46 +359,46 @@ var _default = {
this.$requst.post('/api/spu/un-record', params).then(function (res) {
if (res.code == 0) {
// this.$toolAll.tools.showToast('取消收藏成功');
_this2.getDetail(_this2.id);
_this3.getDetail(_this3.id);
}
});
} else {
this.$requst.post('/api/spu/record', params).then(function (res) {
if (res.code == 0) {
// this.$toolAll.tools.showToast('收藏成功');
_this2.getDetail(_this2.id);
_this3.getDetail(_this3.id);
}
});
}
},
// 加入购物车
joinCart: function joinCart(index) {var _this3 = this;
joinCart: function joinCart(index) {var _this4 = this;
if (this.$toolAll.tools.judgeAuth()) {
this.$requst.post('/api/order/shopping-cart-add', { sku_id: this.shopSku[index].id, num: 1 }).then(function (res) {
if (res.code == 0) {
_this3.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
_this4.$toolAll.tools.showToast('加入购物车成功(*^▽^*)');
(0, _publicApi.getCartNum)();
// 关闭弹窗
_this3.closeSpecs();
_this4.closeSpecs();
} else {
_this3.$toolAll.tools.showToast(res.msg);
_this4.$toolAll.tools.showToast(res.msg);
}
});
}
},
// 立即购买
buyNow: function buyNow(index) {var _this4 = this;
buyNow: function buyNow(index) {var _this5 = this;
if (this.$toolAll.tools.judgeAuth()) {
this.$requst.post('/api/order/shopping-cart-add', { sku_id: this.shopSku[index].id, num: 1 }).then(function (res) {
if (res.code == 0) {
// 关闭弹窗
_this4.closeSpecs();
_this5.closeSpecs();
uni.navigateTo({
url: "/pagesA/cart/cart" });
} else {
_this4.$toolAll.tools.showToast(res.msg);
_this5.$toolAll.tools.showToast(res.msg);
}
});
}

View File

@ -123,18 +123,24 @@ var _default = {
footHeight: function footHeight(state) {return state.moduleA.footHeight;} })),
onLoad: function onLoad(op) {
onLoad: function onLoad(op) {var _this = this;
this.category_id = op.category_id;
this.business_id = op.business_id;
this.getShopScreen(); //查询商品分类
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getShopScreen(); //查询商品分类
}
});
} else {
this.getShopScreen(); //查询商品分类
}
},
onReachBottom: function onReachBottom(e) {
if (this.shopList.length < this.total) {
this.page++;
//查询商品列表
this.getShopList();
} else {
this.totalAll = this.total;
}
},
methods: {
@ -190,29 +196,28 @@ var _default = {
},
// 查询筛选条件
getShopScreen: function getShopScreen() {var _this = this;
getShopScreen: function getShopScreen() {var _this2 = this;
var params = {
category_id: this.category_id,
business_id: this.business_id };
this.$requst.post('/api/spu/condition', params).then(function (res) {
if (res.code == 0) {
console.log(res, '商品分类');
_this.sortList = res.data[0].children; //排序
_this.cateList = res.data[1].children; //分类
for (var key in _this.cateList) {
if (_this.cateList[key].value == _this.category_id) {
_this.cateIndex = key;
_this2.sortList = res.data[0].children; //排序
_this2.cateList = res.data[1].children; //分类
for (var key in _this2.cateList) {
if (_this2.cateList[key].value == _this2.category_id) {
_this2.cateIndex = key;
}
}
//查询商品列表
_this.getShopList();
_this2.getShopList();
}
});
},
// 查询商品列表
getShopList: function getShopList() {var _this2 = this;
getShopList: function getShopList() {var _this3 = this;
uni.showLoading();
this.ifLoading = true;
var params = {
@ -223,8 +228,7 @@ var _default = {
this.$requst.post('/api/spu/list', params).then(function (res) {
if (res.code == 0) {
_this2.total = res.data.total;
console.log(res, '商品列表');
_this3.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
@ -234,7 +238,10 @@ var _default = {
newArr.push(obj);
});
_this2.shopList = newArr;
_this3.shopList = newArr;
if (_this3.shopList.length == _this3.total) {
_this3.totalAll = _this3.total;
}
}
uni.hideLoading();
});

View File

@ -175,8 +175,16 @@ var _default = {
aboutData: '' };
},
onLoad: function onLoad() {
this.getAboutData();
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getAboutData();
}
});
} else {
this.getAboutData();
}
},
// 分享到微信
onShareAppMessage: function onShareAppMessage() {
@ -194,18 +202,18 @@ var _default = {
},
methods: {
// 查询关于我们
getAboutData: function getAboutData() {var _this = this;
getAboutData: function getAboutData() {var _this2 = this;
uni.showLoading();
this.$requst.get('/api/index/about').then(function (res) {
if (res.code == 0) {
_this.aboutData = _this.$toolAll.tools.escape2Html(res.data.content);
_this.latitude = res.data.lat;
_this.longitude = res.data.lon;
_this.address = res.data.address;
_this.markers[0].latitude = res.data.lat;
_this.markers[0].longitude = res.data.lon;
_this2.aboutData = _this2.$toolAll.tools.escape2Html(res.data.content);
_this2.latitude = res.data.lat;
_this2.longitude = res.data.lon;
_this2.address = res.data.address;
_this2.markers[0].latitude = res.data.lat;
_this2.markers[0].longitude = res.data.lon;
} else {
_this.$toolAll.tools.showToast(res.msg);
_this2.$toolAll.tools.showToast(res.msg);
}
uni.hideLoading();
});

View File

@ -1 +1 @@
<view><status-nav vue-id="432585fe-1" ifReturn="{{true}}" navBarTitle="关于我们" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="about-bg" style="{{'min-height:'+(aboutHeight)+';'}}"><view class="about-map"><map style="width:100%;height:390rpx;" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}"></map></view><view data-event-opts="{{[['tap',[['goThere',['$event']]]]]}}" class="navigation-btn" bindtap="__e">导航到我们</view><view class="about"><view class="about-title">免责条款</view><view class="about-txt"><rich-text nodes="{{aboutData}}"></rich-text></view></view></view></view>
<view><status-nav vue-id="432585fe-1" ifReturn="{{true}}" navBarTitle="关于我们" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="about-bg" style="{{'min-height:'+(aboutHeight)+';'}}"><view class="about-map"><map style="width:100%;height:390rpx;" latitude="{{latitude}}" longitude="{{longitude}}" markers="{{markers}}"></map></view><view data-event-opts="{{[['tap',[['goThere',['$event']]]]]}}" class="navigation-btn" bindtap="__e">导航到我们</view><view class="about"><view class="about-title">关于我们</view><view class="about-txt"><rich-text nodes="{{aboutData}}"></rich-text></view></view></view></view>

View File

@ -0,0 +1,5 @@
page.data-v-022a7c08{
background-color: #FFFFFF !important;
}

View File

@ -157,18 +157,26 @@ var _default = {
disclaimers: '' };
},
onLoad: function onLoad() {
this.getDisclaimers();
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getDisclaimers();
}
});
} else {
this.getDisclaimers();
}
},
methods: {
// 查询免责声明
getDisclaimers: function getDisclaimers() {var _this = this;
getDisclaimers: function getDisclaimers() {var _this2 = this;
uni.showLoading();
this.$requst.get('/api/index/statement').then(function (res) {
if (res.code == 0) {
_this.disclaimers = _this.$toolAll.tools.escape2Html(res.data.content);
_this2.disclaimers = _this2.$toolAll.tools.escape2Html(res.data.content);
} else {
_this.$toolAll.tools.showToast(res.msg);
_this2.$toolAll.tools.showToast(res.msg);
}
uni.hideLoading();
});

View File

@ -191,6 +191,7 @@ __webpack_require__.r(__webpack_exports__);
var _publicApi = __webpack_require__(/*! @/jsFile/public-api.js */ 9);
@ -216,7 +217,8 @@ var _default = {
isShop: true, //是否商品
totalAll: -1, //判断总数
historyData: [], //历史搜索列表
keyword: '' //搜索关键词
keyword: '', //搜索关键词
keywords: '' //历史关键词
};
},
computed: _objectSpread({},
@ -225,19 +227,15 @@ var _default = {
onLoad: function onLoad(op) {
this.keyword = op.keyword;
this.getSearchList();
this.keywords = op.keyword;
this.getSearchList(this.keywords);
this.getHistory();
},
onReachBottom: function onReachBottom(e) {
if (this.searchList.length < this.total) {
this.page++;
this.getSearchList();
} else {
this.totalAll = this.total;
return false;
}
},
methods: {
// 切换事件
@ -289,29 +287,48 @@ var _default = {
//搜索
toSearch: function toSearch() {
if (this.keyword !== '') {
this.keywords = this.keyword;
this.getSearchList();
this.getHistory();
}
},
// 选择历史搜索
changeKeyword: function changeKeyword(keyword) {
this.keyword = keyword;
this.getSearchList();
this.getHistory();
this.keywords = keyword;
var isRequest = uni.getStorageSync('isRequest');
if (isRequest) {
this.getSearchList();
this.getHistory();
}
},
// 清空历史搜索
clearHistory: function clearHistory() {
clearHistory: function clearHistory() {var _this2 = this;
if (this.currentIndex == 0) {
this.$requst.get('/api/index/clear-keyword-history', { type: 'spu' }).then(function (res) {
if (res.code == 0) {
_this2.historyData = [];
}
});
}
if (this.currentIndex == 1) {
this.$requst.get('/api/index/clear-keyword-history', { type: 'article' }).then(function (res) {
if (res.code == 0) {
_this2.historyData = [];
}
});
}
},
// 获取搜索结果
getSearchList: function getSearchList() {var _this2 = this;
getSearchList: function getSearchList() {var _this3 = this;
var params = {
keyword: this.keyword };
keyword: this.keywords };
if (this.currentIndex == 0) {
this.$requst.get('/api/spu/list', params).then(function (res) {
if (res.code == 0) {
_this2.total = res.data.total;
_this3.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
@ -322,25 +339,33 @@ var _default = {
newArr.push(obj);
});
_this2.searchList = newArr;
_this3.searchList = newArr;
_this3.keyword = '';
if (_this3.searchList.length == _this3.total) {
_this3.totalAll = _this3.total;
}
}
});
}
if (this.currentIndex == 1) {
this.$requst.get('/api/archives/list', params).then(function (res) {
if (res.code == 0) {
_this2.total = res.data.total;
_this3.total = res.data.total;
var newArr = [];
res.data.list.forEach(function (item) {
var obj = {
id: item.id,
src: item.cover,
title: item.title,
time: _this2.dateFormat(item.published_at) };
time: _this3.dateFormat(item.published_at) };
newArr.push(obj);
});
_this2.searchList = newArr;
_this3.searchList = newArr;
_this3.keyword = '';
if (_this3.searchList.length == _this3.total) {
_this3.totalAll = _this3.total;
}
}
});
}

View File

@ -1 +1 @@
<view><status-nav vue-id="56ee474c-1" ifReturn="{{true}}" navBarTitle="搜索" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="search-bg" style="padding-bottom:0rpx;"><view class="search flex"><image class="search-img" src="/static/public/icon-search.png" mode="widthFix"></image><input class="search-input" type="text" placeholder="请输入关键词" placeholder-style="color: #666666" data-event-opts="{{[['input',[['__set_model',['','keyword','$event',[]]]]]]}}" value="{{keyword}}" bindinput="__e"/><view class="search-line"></view><view data-event-opts="{{[['tap',[['toSearch',['$event']]]]]}}" class="search-btn flex" bindtap="__e">搜索</view></view></view><view class="nav-list-bg" style="{{'top:'+(newTop+'px')+';'}}"><nav-tab vue-id="56ee474c-2" list="{{navTabList}}" type="radio" data-event-opts="{{[['^chooseEv',[['chooseEv']]]]}}" bind:chooseEv="__e" bind:__l="__l"></nav-tab></view><block wx:if="{{historyData.length>0}}"><view class="search-history flex"><view class="title flex"><text>历史搜索</text><image class="search-img" src="/static/public/icon-clear.png" mode="widthFix" data-event-opts="{{[['tap',[['clearHistory',['$event']]]]]}}" bindtap="__e"></image></view><block wx:for="{{historyData}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeKeyword',['$0'],[[['historyData','',index,'keyword']]]]]]]}}" class="item clips1" bindtap="__e">{{item.keyword}}</view></block></view></block><view class="news-list-bg"><pull-list vue-id="56ee474c-3" list="{{searchList}}" isShop="{{isShop}}" data-event-opts="{{[['^toDetail',[['toDetail']]]]}}" bind:toDetail="__e" bind:__l="__l"></pull-list></view><block wx:if="{{totalAll==total}}"><view class="more-txt more-txt-other">暂无更多内容</view></block></view>
<view><status-nav vue-id="56ee474c-1" ifReturn="{{true}}" navBarTitle="搜索" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="search-bg" style="padding-bottom:0rpx;"><view class="search flex"><image class="search-img" src="/static/public/icon-search.png" mode="widthFix"></image><input class="search-input" type="text" placeholder="请输入关键词" placeholder-style="color: #666666" data-event-opts="{{[['input',[['__set_model',['','keyword','$event',[]]]]]]}}" value="{{keyword}}" bindinput="__e"/><view class="search-line"></view><view data-event-opts="{{[['tap',[['toSearch',['$event']]]]]}}" class="search-btn flex" bindtap="__e">搜索</view></view></view><view class="nav-list-bg" style="{{'top:'+(newTop+'px')+';'}}"><nav-tab vue-id="56ee474c-2" list="{{navTabList}}" type="radio" data-event-opts="{{[['^chooseEv',[['chooseEv']]]]}}" bind:chooseEv="__e" bind:__l="__l"></nav-tab></view><block wx:if="{{historyData.length>0&&total==0}}"><view class="search-history flex"><view class="title flex"><text>历史搜索</text><image class="search-img" src="/static/public/icon-clear.png" mode="widthFix" data-event-opts="{{[['tap',[['clearHistory',['$event']]]]]}}" bindtap="__e"></image></view><block wx:for="{{historyData}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['changeKeyword',['$0'],[[['historyData','',index,'keyword']]]]]]]}}" class="item clips1" bindtap="__e">{{item.keyword}}</view></block></view></block><block wx:if="{{total!==0}}"><view class="search-keyword">关键词:<text>{{keywords}}</text>(<text>{{total}}</text>)</view></block><view class="news-list-bg"><pull-list vue-id="56ee474c-3" list="{{searchList}}" isShop="{{isShop}}" data-event-opts="{{[['^toDetail',[['toDetail']]]]}}" bind:toDetail="__e" bind:__l="__l"></pull-list></view><block wx:if="{{totalAll==total}}"><view class="more-txt more-txt-other">暂无更多内容</view></block></view>

View File

@ -225,25 +225,33 @@ var _default = {
computed: {},
onLoad: function onLoad(op) {
this.getUserData();
onLoad: function onLoad(op) {var _this = this;
if (op.business_id) {
this.$requst.post('/api/index/change-business', { business_id: op.business_id }).then(function (res) {
if (res.code == 0) {
_this.getUserData();
}
});
} else {
this.getUserData();
}
},
onShow: function onShow() {
},
methods: {
// 获取用户信息
getUserData: function getUserData() {var _this = this;
getUserData: function getUserData() {var _this2 = this;
uni.showLoading();
this.$requst.get('/api/user/info').then(function (res) {
console.log(res, '用户信息');
if (res.code == 0) {
_this.headImgUrl = res.data.headimgurl;
_this.nickName = res.data.nickname;
_this.businessCode = res.data.business_code;
_this.realName = res.data.real_name;
_this.mobile = res.data.mobile;
_this.area = res.data.area;
_this.address = res.data.address;
_this2.headImgUrl = res.data.headimgurl;
_this2.nickName = res.data.nickname;
_this2.businessCode = res.data.business_code;
_this2.realName = res.data.real_name;
_this2.mobile = res.data.mobile;
_this2.area = res.data.area;
_this2.address = res.data.address;
}
uni.hideLoading();
});
@ -285,7 +293,7 @@ var _default = {
}
},
// 提交修改
submitEdit: function submitEdit(field, value) {var _this2 = this;
submitEdit: function submitEdit(field, value) {var _this3 = this;
uni.showLoading();
if (field !== '' && value !== '') {
var params = {
@ -294,11 +302,11 @@ var _default = {
this.$requst.post('/api/user/update-info', params).then(function (res) {
if (res.code == 0) {
_this2.$toolAll.tools.showToast('修改成功');
_this3.$toolAll.tools.showToast('修改成功');
// 关闭弹窗
_this2.closeEdit();
_this3.closeEdit();
// 刷新用户信息
_this2.getUserData();
_this3.getUserData();
}
uni.hideLoading();
});
@ -319,7 +327,7 @@ var _default = {
this.type = '';
},
// 获取授权信息
onGetPhoneNumber: function onGetPhoneNumber(e) {var _this3 = this;
onGetPhoneNumber: function onGetPhoneNumber(e) {var _this4 = this;
if (e.detail.errMsg == "getPhoneNumber:fail user deny") {//用户决绝授权
this.$toolAll.tools.showToast('您已拒绝授权');
} else {//允许授权
@ -329,35 +337,35 @@ var _default = {
this.$requst.post('/api/user/bind-phone', params).then(function (res) {
if (res.code == 0) {
_this3.$toolAll.tools.showToast('绑定成功');
_this4.$toolAll.tools.showToast('绑定成功');
// 刷新用户信息
_this3.getUserData();
_this4.getUserData();
} else {
_this3.$toolAll.tools.showToast(res.msg);
_this4.$toolAll.tools.showToast(res.msg);
}
});
}
},
// 选择图片
changeHeadImg: function changeHeadImg() {var _this4 = this;
changeHeadImg: function changeHeadImg() {var _this5 = this;
uni.chooseImage({
count: 1, //默认9
sourceType: ['album', 'camera'], //从相册选择
success: function success(res) {
_this4.headImg = res.tempFilePaths[0];
_this4.uploadImg();
_this5.headImg = res.tempFilePaths[0];
_this5.uploadImg();
} });
},
// 上传图片
uploadImg: function uploadImg() {var _this5 = this;
uploadImg: function uploadImg() {var _this6 = this;
uni.showLoading();
this.$requst.upload('/api/file/upload/image', { path: this.headImg }).then(function (res) {
if (res.code == 0) {
_this5.headImgUrl = _this5.$hostHttp + res.data.src;
_this6.headImgUrl = _this6.$hostHttp + res.data.src;
// 修改信息
_this5.submitEdit('headimgurl', _this5.headImgUrl);
_this6.submitEdit('headimgurl', _this6.headImgUrl);
}
uni.hideLoading();
});

View File

@ -1 +1 @@
<view class="{{[editRealName&editMobile&editArea&editAddress?'':'pad-b150']}}"><status-nav vue-id="54360644-1" ifReturn="{{true}}" navBarTitle="个人中心" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="ucenter"><view class="item flex"><view class="title">头像</view><view data-event-opts="{{[['tap',[['changeHeadImg',['$event']]]]]}}" class="img" bindtap="__e"><image src="{{headImgUrl}}" mode="widthFix"></image></view></view><view class="item flex"><view class="title">昵称</view><view class="msg">{{nickName}}</view></view><view data-event-opts="{{[['tap',[['openEdit',['real_name']]]]]}}" class="item flex" bindtap="__e"><view class="title">真实姓名</view><input class="msg" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','realName','$event',[]]]]]]}}" value="{{realName}}" bindinput="__e"/><view class="more"><image src="/static/public/icon-my-more.png" mode="widthFix"></image></view></view><view class="item flex" style="position:relative;"><view class="title">联系电话</view><input class="msg" type="number" disabled="true" data-event-opts="{{[['input',[['__set_model',['','mobile','$event',[]]]]]]}}" value="{{mobile}}" bindinput="__e"/><view class="more"><image src="/static/public/icon-my-more.png" mode="widthFix"></image></view><button class="get-phone-btn" open-type="getPhoneNumber" data-event-opts="{{[['getphonenumber',[['onGetPhoneNumber',['$event']]]]]}}" bindgetphonenumber="__e"></button></view><view data-event-opts="{{[['tap',[['openEdit',['area']]]]]}}" class="item flex" bindtap="__e"><view class="title">联系地址</view><input class="msg" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','area','$event',[]]]]]]}}" value="{{area}}" bindinput="__e"/><view class="more"><image src="/static/public/icon-my-more.png" mode="widthFix"></image></view></view><view data-event-opts="{{[['tap',[['openEdit',['address']]]]]}}" class="item flex" bindtap="__e"><view class="title">详细地址</view><input class="msg" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','address','$event',[]]]]]]}}" value="{{address}}" bindinput="__e"/><view class="more"><image src="/static/public/icon-my-more.png" mode="widthFix"></image></view></view><block wx:if="{{businessCode!==''}}"><view class="item flex"><view class="title">会员码</view><view class="msg">{{businessCode}}</view></view></block></view><view data-event-opts="{{[['tap',[['closeEdit',['$event']]]]]}}" hidden="{{!(isOpen)}}" class="pull-all-bg" bindtap="__e"></view><block wx:if="{{isOpen}}"><view class="edit-box-bg"><view class="edit-box"><view class="title">{{title}}</view><view class="subtitle">{{subtitle}}</view><block wx:if="{{type=='input'}}"><input class="input" type="text" placeholder="{{placeholder}}" placeholder-color="#c9c9c9" data-event-opts="{{[['input',[['__set_model',['','msg','$event',[]]]]]]}}" value="{{msg}}" bindinput="__e"/></block><block wx:if="{{type=='textarea'}}"><textarea class="textarea" placeholder="{{placeholder}}" placeholder-color="#c9c9c9" data-event-opts="{{[['input',[['__set_model',['','msg','$event',[]]]]]]}}" value="{{msg}}" bindinput="__e"></textarea></block><view class="edit-btns"><view data-event-opts="{{[['tap',[['closeEdit',['$event']]]]]}}" class="btn" bindtap="__e">取消</view><view data-event-opts="{{[['tap',[['submitEdit',['$0','$1'],['field','msg']]]]]}}" class="btn" bindtap="__e">确认</view></view></view></view></block></view>
<view class="{{[editRealName&editMobile&editArea&editAddress?'':'pad-b150']}}"><status-nav vue-id="54360644-1" ifReturn="{{true}}" navBarTitle="个人中心" marginBottom="{{0}}" bind:__l="__l"></status-nav><view class="ucenter"><view class="item flex"><view class="title">头像</view><view class="img"><image src="{{headImgUrl}}" mode="widthFix"></image></view></view><view class="item flex"><view class="title">昵称</view><view class="msg">{{nickName}}</view></view><view data-event-opts="{{[['tap',[['openEdit',['real_name']]]]]}}" class="item flex" bindtap="__e"><view class="title">真实姓名</view><input class="msg" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','realName','$event',[]]]]]]}}" value="{{realName}}" bindinput="__e"/><view class="more"><image src="/static/public/icon-my-more.png" mode="widthFix"></image></view></view><view class="item flex" style="position:relative;"><view class="title">联系电话</view><input class="msg" type="number" disabled="true" data-event-opts="{{[['input',[['__set_model',['','mobile','$event',[]]]]]]}}" value="{{mobile}}" bindinput="__e"/><view class="more"><image src="/static/public/icon-my-more.png" mode="widthFix"></image></view><button class="get-phone-btn" open-type="getPhoneNumber" data-event-opts="{{[['getphonenumber',[['onGetPhoneNumber',['$event']]]]]}}" bindgetphonenumber="__e"></button></view><view data-event-opts="{{[['tap',[['openEdit',['area']]]]]}}" class="item flex" bindtap="__e"><view class="title">联系地址</view><input class="msg" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','area','$event',[]]]]]]}}" value="{{area}}" bindinput="__e"/><view class="more"><image src="/static/public/icon-my-more.png" mode="widthFix"></image></view></view><view data-event-opts="{{[['tap',[['openEdit',['address']]]]]}}" class="item flex" bindtap="__e"><view class="title">详细地址</view><input class="msg" type="text" disabled="true" data-event-opts="{{[['input',[['__set_model',['','address','$event',[]]]]]]}}" value="{{address}}" bindinput="__e"/><view class="more"><image src="/static/public/icon-my-more.png" mode="widthFix"></image></view></view><block wx:if="{{businessCode!==''}}"><view class="item flex"><view class="title">会员码</view><view class="msg">{{businessCode}}</view></view></block></view><view data-event-opts="{{[['tap',[['closeEdit',['$event']]]]]}}" hidden="{{!(isOpen)}}" class="pull-all-bg" bindtap="__e"></view><block wx:if="{{isOpen}}"><view class="edit-box-bg"><view class="edit-box"><view class="title">{{title}}</view><view class="subtitle">{{subtitle}}</view><block wx:if="{{type=='input'}}"><input class="input" type="text" placeholder="{{placeholder}}" placeholder-color="#c9c9c9" data-event-opts="{{[['input',[['__set_model',['','msg','$event',[]]]]]]}}" value="{{msg}}" bindinput="__e"/></block><block wx:if="{{type=='textarea'}}"><textarea class="textarea" placeholder="{{placeholder}}" placeholder-color="#c9c9c9" data-event-opts="{{[['input',[['__set_model',['','msg','$event',[]]]]]]}}" value="{{msg}}" bindinput="__e"></textarea></block><view class="edit-btns"><view data-event-opts="{{[['tap',[['closeEdit',['$event']]]]]}}" class="btn" bindtap="__e">取消</view><view data-event-opts="{{[['tap',[['submitEdit',['$0','$1'],['field','msg']]]]]}}" class="btn" bindtap="__e">确认</view></view></view></view></block></view>

View File

@ -0,0 +1,36 @@
{
"setting": {},
"condition": {
"plugin": {
"list": []
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": [
{
"name": "",
"pathName": "pages/tabbar/index/index",
"query": "business_id=7",
"scene": null
},
{
"name": "",
"pathName": "pages/tabbar/index/index",
"query": "business_id=0",
"scene": null
},
{
"name": "",
"pathName": "pages/tabbar/cate/cate",
"query": "business_id=7",
"scene": null
}
]
}
}
}