对接原系统
This commit is contained in:
+34
-58
@@ -3,7 +3,8 @@
|
||||
<!-- #ifndef APP-NVUE || MP-TOUTIAO -->
|
||||
<block v-if="ads.length > 0" v-for="(ad,index) in ads" :key="index">
|
||||
<view class="uv-demo-block" style="width: 698rpx; margin: auto">
|
||||
<uv-swiper :list="JSON.parse(ad.images)" :height="180" bgColor="transparent" indicatorMode="dot" indicator circular
|
||||
<uv-swiper :list="JSON.parse(ad.images)" :height="180" bgColor="transparent" indicatorMode="dot" indicator
|
||||
circular
|
||||
:autoplay="false"
|
||||
radius="5" @click="onSlide"></uv-swiper>
|
||||
</view>
|
||||
@@ -39,8 +40,8 @@
|
||||
<uni-grid :column="5" :highlight="true" :showBorder="false" @change="onItem">
|
||||
<uni-grid-item v-for="(item, index) in itemList" :index="index" :key="index">
|
||||
<view
|
||||
class="grid-item-box"
|
||||
style="
|
||||
class="grid-item-box"
|
||||
style="
|
||||
background-color: #ffffff;
|
||||
margin: 10rpx;
|
||||
border-radius: 10rpx;
|
||||
@@ -67,12 +68,12 @@
|
||||
<!-- 商户列表 -->
|
||||
<view class="card-title web-text-heading">场地预定</view>
|
||||
<view class="card-body">
|
||||
<block v-if="merchant.length > 0">
|
||||
<block v-if="siteList.length > 0">
|
||||
<uni-grid :column="3" borderColor="transparent" :highlight="true" @change="change">
|
||||
<uni-grid-item v-for="(item, index) in merchant" :index="index" :key="index">
|
||||
<uni-grid-item v-for="(item, index) in siteList" :index="index" :key="index">
|
||||
<view class="merchant-card" style="display: flex; flex-direction: column">
|
||||
<image :src="item.image" mode="widthFix" class="merchant-image"/>
|
||||
<text class="merchant-name">{{ item.merchantName }}</text>
|
||||
<image :src="item.thumb" mode="widthFix" class="merchant-image"/>
|
||||
<text class="merchant-name">{{ item.name }}</text>
|
||||
</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
@@ -108,7 +109,8 @@ import {updateUsers} from '@/api/shop/users';
|
||||
import {useMpStore} from "@/store/modules/mp";
|
||||
import Layout from "@/components/layout.vue";
|
||||
import * as MenuIcons from '@/api/menu-icons.ts';
|
||||
import { openUrl } from '@/utils/common';
|
||||
import {openUrl} from '@/utils/common';
|
||||
import {listThinkSite} from "@/api/think/thinkSite";
|
||||
|
||||
const mpStore = useMpStore();
|
||||
|
||||
@@ -140,25 +142,8 @@ export default {
|
||||
// 骨架屏
|
||||
hideTools: true,
|
||||
mp_menu_display_method: 0,
|
||||
baseList: [
|
||||
{
|
||||
name: 'photo',
|
||||
title: '李白'
|
||||
},
|
||||
{
|
||||
name: 'lock',
|
||||
title: '韩信'
|
||||
},
|
||||
{
|
||||
name: 'star',
|
||||
title: '刘备'
|
||||
},
|
||||
{
|
||||
name: 'star',
|
||||
title: '元芳'
|
||||
}
|
||||
],
|
||||
openid: null
|
||||
openid: null,
|
||||
siteList: []
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
@@ -180,16 +165,6 @@ export default {
|
||||
if (uni.getStorageSync('user_id') && uni.getStorageSync('access_token')) {
|
||||
app.isLogin = true;
|
||||
if (!uni.getStorageSync('openid')) {
|
||||
// 获取用户副表信息
|
||||
// UserApi.getByPhone({
|
||||
// phone: info.userInfo.phone
|
||||
// }).then((data) => {
|
||||
// if (data) {
|
||||
// app.userInfo.ouid = data.uid;
|
||||
// uni.setStorageSync('ouid', data.uid);
|
||||
// app.userInfo = Object.assign({}, app.userInfo, data);
|
||||
// }
|
||||
// });
|
||||
// 更新openid
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.login({
|
||||
@@ -271,41 +246,42 @@ export default {
|
||||
}
|
||||
|
||||
// 请求数据
|
||||
Promise.all([app.getMerchantList(), app.getItemList()]).then((res) => {
|
||||
Promise.all([app.getMerchantList(), this.getSiteList()]).then((res) => {
|
||||
app.merchant = res[0];
|
||||
app.itemList = res[1];
|
||||
// app.itemList = res[1];
|
||||
});
|
||||
},
|
||||
getSiteInfo() {
|
||||
const app = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
Api.getSiteInfo()
|
||||
.then((result) => {
|
||||
resolve(result);
|
||||
})
|
||||
.catch(reject);
|
||||
.then((result) => {
|
||||
resolve(result);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
listAdList() {
|
||||
async getSiteList() {
|
||||
this.siteList = await listThinkSite()
|
||||
},
|
||||
pageGoods() {
|
||||
const app = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
GoodsApi.pageGoods({})
|
||||
.then((result) => {
|
||||
resolve(result.list);
|
||||
})
|
||||
.catch(reject);
|
||||
.then((result) => {
|
||||
resolve(result.list);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
getMerchantList() {
|
||||
const app = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
MerchantApi.listMerchant({})
|
||||
.then((result) => {
|
||||
resolve(result);
|
||||
})
|
||||
.catch(reject);
|
||||
.then((result) => {
|
||||
resolve(result);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
navTo(item) {
|
||||
@@ -315,15 +291,15 @@ export default {
|
||||
const app = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
ItemApi.listItem({})
|
||||
.then((result) => {
|
||||
resolve(result);
|
||||
})
|
||||
.catch(reject);
|
||||
.then((result) => {
|
||||
resolve(result);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
change(e) {
|
||||
const {index} = e.detail;
|
||||
const id = this.merchant[index].merchantId;
|
||||
const id = this.siteList[index].id;
|
||||
this.openUrl(`/package/booking/index?id=${id}`);
|
||||
},
|
||||
onNavigation(e) {
|
||||
@@ -355,7 +331,7 @@ export default {
|
||||
this.ad279 = this.getAdImageUrl(ads.find(d => d.adId === 279));
|
||||
},
|
||||
getAdImageUrl(item) {
|
||||
if(!item){
|
||||
if (!item) {
|
||||
return [];
|
||||
}
|
||||
const json = JSON.parse(item.images);
|
||||
|
||||
Reference in New Issue
Block a user