Commit 6f21af0b authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents 8cfcc9c9 88382beb
<script setup> <script setup>
import { getTokenUser } from './api/index'; onLaunch(() => {});
import { sgyOrderGetStatus } from './api/order';
import testJson from './static/json/test.json';
import { getToken } from './utils/auth';
import { setOrderDic } from './utils/orderDic';
// beforeMount(() => {
// if (!getToken()) signIn();
// });
onLaunch(() => {
if (!getToken()) signIn();
sgyOrderGetStatus().then((res) => {
if (res.code === 0) {
setOrderDic(res.data.store);
}
});
});
onShow(() => { onShow(() => {
console.log('App Show'); console.log('App Show');
...@@ -23,22 +8,6 @@ onShow(() => { ...@@ -23,22 +8,6 @@ onShow(() => {
onHide(() => { onHide(() => {
console.log('App Hide'); console.log('App Hide');
}); });
// 登录
const signIn = () => {
xma.xh.getUserProfile({
range: ['ACCOUNT', 'MOBILE', 'CITIZEN'],
async success(info) {
const info2 = JSON.stringify(info);
getTokenUser(info2).then((res) => {
const token = res.data.access_token;
const userInfo = res.data.user_info;
xma.setStorageSync('Authorization', token);
xma.setStorageSync('userInfo', userInfo);
console.log('登录...');
});
},
});
};
</script> </script>
<style> <style>
.multi-line { .multi-line {
......
...@@ -31,13 +31,13 @@ const title = ref('小程序平台'); ...@@ -31,13 +31,13 @@ const title = ref('小程序平台');
const { countInfo, addCount } = useCountStore(); const { countInfo, addCount } = useCountStore();
const test = ref(''); const test = ref('');
onMounted(() => { onMounted(() => {
xma.xh.getUserProfile({ // xma.xh.getUserProfile({
range: ['ACCOUNT', 'MOBILE', 'CITIZEN'], // range: ['ACCOUNT', 'MOBILE', 'CITIZEN'],
async success(info) { // async success(info) {
const info2 = JSON.stringify(info); // const info2 = JSON.stringify(info);
test.value = info2; // test.value = info2;
}, // },
}); // });
}); });
const search = (res) => { const search = (res) => {
......
...@@ -6,6 +6,13 @@ ...@@ -6,6 +6,13 @@
} }
}, },
"pages": [ "pages": [
{
"path": "pages/index/loading",
"style": {
"navigationBarTitleText": "加载",
"navigationStyle":"custom"
}
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
......
...@@ -155,7 +155,9 @@ import FoodDetails from '../../components/index/FoodDetails.vue'; ...@@ -155,7 +155,9 @@ import FoodDetails from '../../components/index/FoodDetails.vue';
import ShopCard from '../../components/index/ShopCard.vue'; import ShopCard from '../../components/index/ShopCard.vue';
import Marketing from '../../components/index/Marketing.vue'; import Marketing from '../../components/index/Marketing.vue';
import Position from '../../components/index/Position.vue'; import Position from '../../components/index/Position.vue';
import { orderStatus } from '../../utils/signIn';
import { import {
getTokenUser,
groupBuyList, groupBuyList,
groupImgList, groupImgList,
popularityPage, popularityPage,
...@@ -165,9 +167,8 @@ import { ...@@ -165,9 +167,8 @@ import {
receiveCoupon, receiveCoupon,
} from '../../api/index'; } from '../../api/index';
import { timeConversion } from '../../utils/tool'; import { timeConversion } from '../../utils/tool';
const nowTime = ref(new Date().getTime());
// import testJson from '../../static/json/test.json'; // import testJson from '../../static/json/test.json';
// import { getToken } from '../../utils/auth'; const nowTime = ref(new Date().getTime());
const title = ref('小程序平台'); const title = ref('小程序平台');
const { countInfo, addCount } = useCountStore(); const { countInfo, addCount } = useCountStore();
// 附近美食 // 附近美食
...@@ -205,7 +206,8 @@ const coupon = ref([]); ...@@ -205,7 +206,8 @@ const coupon = ref([]);
let total; let total;
// 轮播图数据 // 轮播图数据
let lunboData; let lunboData;
onMounted(() => { onMounted(async () => {
orderStatus();
getClassification(); getClassification();
rotatingBroadcast(); rotatingBroadcast();
nearbyFood(); nearbyFood();
...@@ -213,6 +215,7 @@ onMounted(() => { ...@@ -213,6 +215,7 @@ onMounted(() => {
getMerchantList(); getMerchantList();
getCouponMainList(); getCouponMainList();
}); });
function jumpProductDetails(item) { function jumpProductDetails(item) {
xma.navigateTo({ xma.navigateTo({
url: '/pages/shop/shop?shopId=' + item.shopId, url: '/pages/shop/shop?shopId=' + item.shopId,
......
<template>
<view class="loading"></view>
</template>
<script setup>
import {} from 'vue';
import { signIn } from '../../utils/signIn';
import testJson from '../../static/json/test.json';
import { getTokenUser } from '../../api/index';
import { getToken } from '../../utils/auth';
onMounted(async () => {
// await signIn();
if (!getToken()) await signIn2();
xma.reLaunch({ url: '/pages/index/index' });
});
// 登录
const signIn2 = () => {
xma.showLoading({
title: '加载中',
mask: true,
});
return getTokenUser(testJson).then((res) => {
const token = res.data.access_token;
const userInfo = res.data.user_info;
xma.setStorageSync('Authorization', token);
xma.setStorageSync('userInfo', userInfo);
console.log('登录...');
});
};
</script>
<style lang="scss" scoped></style>
...@@ -96,17 +96,61 @@ ...@@ -96,17 +96,61 @@
class="img1" class="img1"
></wd-upload> ></wd-upload>
</view> </view>
<view class="flex">
<view class="logo">店铺分类</view>
<view class="text" @click="showclass">请选择</view>
</view>
<wd-textarea <wd-textarea
placeholder="请填写评价" placeholder="请填写评价"
label="店铺介绍" label="店铺介绍"
label-width="100px" label-width="100px"
v-model="formData.szdq" v-model="formData.szdq"
prop="szdq" prop="szdq"
:no-border="false"
/> />
<button type="primary" style="width: 80%">提交</button> <button type="primary" style="width: 80%">提交</button>
</wd-cell-group> </wd-cell-group>
<wd-popup
v-model="show"
position="bottom"
custom-style="height:300px;overflow:auto;"
@close="handleClose"
>
<view class="hcontent">
<view class="flex1">
<view class="text">取消</view>
<view class="text">请选择</view>
<view class="text">确定</view>
</view>
<view class="nr">
<view class="left">
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
</view>
<view class="right">
<view class="item">
<view class="hname">生活用品</view>
<view class="hnr">
<wd-tag round>标签</wd-tag>
<wd-tag round>标签</wd-tag>
<wd-tag round>标签</wd-tag>
<wd-tag round>标签</wd-tag>
</view>
</view>
</view>
</view>
</view>
</wd-popup>
</wd-form> </wd-form>
</view> </view>
</view> </view>
...@@ -125,11 +169,15 @@ const promotionlist = ref([ ...@@ -125,11 +169,15 @@ const promotionlist = ref([
label: '连锁加盟', label: '连锁加盟',
}, },
]); ]);
const show = ref(false);
const fileList = ref([ const fileList = ref([
{ {
url: '1', url: '1',
}, },
]); ]);
const showclass = () => {
show.value = true;
};
function chooseImage({ fileList: files }) { function chooseImage({ fileList: files }) {
xma.chooseImage({ xma.chooseImage({
...@@ -175,8 +223,59 @@ const getLocationFn = () => { ...@@ -175,8 +223,59 @@ const getLocationFn = () => {
<style lang="scss" scoped> <style lang="scss" scoped>
page { page {
background: #f3f3f3; background: #fff;
} }
.uni-textarea-placeholder,
.uni-textarea-line,
.uni-textarea-compute,
.uni-textarea-textarea {
width: 400rpx;
height: 220rpx;
border: 1px solid #d5d1d1;
}
.wd-tag {
margin-left: 15rpx;
}
.hcontent {
height: 100%;
.flex1 {
padding: 10px;
display: flex;
position: fixed;
width: 100%;
justify-content: space-between;
box-sizing: border-box;
border-bottom: 1px solid #ccc;
background: #fff;
z-index: 6;
}
.nr {
padding-top: 42px;
display: flex;
.left {
background: #ebe7e7;
width: 33%;
height: 100%;
overflow-y: auto;
.name {
text-align: center;
height: 40px;
line-height: 40px;
}
}
.right {
background: #fff;
width: 67%;
.hname {
font-size: 14px;
margin: 15rpx;
padding-bottom: 10px;
border-bottom: 1px solid #ccc;
}
}
}
}
.container { .container {
width: 375 * 2rpx; width: 375 * 2rpx;
margin: 0 auto; margin: 0 auto;
...@@ -196,6 +295,12 @@ page { ...@@ -196,6 +295,12 @@ page {
padding: var(--wot-input-cell-padding, 10px) padding: var(--wot-input-cell-padding, 10px)
var(--wot-input-padding, var(--wot-size-side-padding, 15px)); var(--wot-input-padding, var(--wot-size-side-padding, 15px));
background-color: var(--wot-input-cell-bg, var(--wot-color-white, rgb(255, 255, 255))); background-color: var(--wot-input-cell-bg, var(--wot-color-white, rgb(255, 255, 255)));
.text {
margin-left: 16px;
width: 60%;
font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px));
color: var(--wot-input-placeholder-color, #bfbfbf);
}
.logo { .logo {
position: relative; position: relative;
padding-left: 12px; padding-left: 12px;
......
import { getTokenUser } from '../api/index';
import { sgyOrderGetStatus } from '../api/order';
import { setOrderDic } from '../utils/orderDic';
// 登录
export const signIn = () => {
xma.showLoading({
title: '加载中',
mask: true,
});
return new Promise((resolve, reject) => {
xma.xh.getUserProfile({
range: ['ACCOUNT', 'MOBILE', 'CITIZEN'],
success(info) {
getTokenUser(info.data).then((res) => {
xma.hideLoading();
const token = res.data.access_token;
const userInfo = res.data.user_info;
xma.setStorageSync('Authorization', token);
xma.setStorageSync('userInfo', userInfo);
resolve();
});
},
});
});
};
export const orderStatus = () => {
sgyOrderGetStatus().then((res) => {
if (res.code === 0) {
setOrderDic(res.data.store);
}
});
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment