|
|
@@ -3,8 +3,13 @@
|
|
|
<view class="header_logo">
|
|
|
<image :src="`${constant.imgUrl}/ghs/home_page/logo.png`" mode="widthFix"></image>
|
|
|
|
|
|
- <view @click="register()" class="free_register" v-if="getLoginInfo.openShop == 1">免费注册</view>
|
|
|
- <div v-if="getLoginInfo.openShop != 1" class="free_register">已申请</div>
|
|
|
+ <view class="header_logo-more">
|
|
|
+ <view class="experience" v-if="getLoginInfo.showDemo==1" @tap="experienceFun">体验</view>
|
|
|
+ <view @click="register()" class="free_register" v-if="getLoginInfo.openShop == 1">免费注册</view>
|
|
|
+ <view v-if="getLoginInfo.openShop != 1" class="free_register">已申请</view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
<view class="main">
|
|
|
<view class="banner_box">
|
|
|
@@ -35,11 +40,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import store from '@/store'
|
|
|
import AppSwiper from "@/components/app-swiper";
|
|
|
import AppImg from "@/components/app-img";
|
|
|
import { applyStatus } from "@/api/official";
|
|
|
import { share } from "@/mixins";
|
|
|
-import { mapGetters } from "vuex";
|
|
|
+import { postWxCode,getDictionaries } from '@/api/mini'
|
|
|
+import { getUser } from '@/utils/auth'
|
|
|
+import {mapActions, mapGetters} from "vuex";
|
|
|
+import util from "../../utils/util";
|
|
|
export default {
|
|
|
components: {
|
|
|
AppSwiper,
|
|
|
@@ -107,15 +116,69 @@ export default {
|
|
|
...mapGetters(["getLoginInfo"])
|
|
|
},
|
|
|
methods: {
|
|
|
- register(){
|
|
|
- this.$util.pageTo({
|
|
|
- url: '/pagesClient/official/pay',
|
|
|
- query: {
|
|
|
- ...this.option
|
|
|
- },
|
|
|
- type: 2
|
|
|
- })
|
|
|
- }
|
|
|
+ ...mapActions(['setUserShopAll']),
|
|
|
+ register(){
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: '/pagesClient/official/pay',
|
|
|
+ query: {
|
|
|
+ ...this.option
|
|
|
+ },
|
|
|
+ type: 2
|
|
|
+ })
|
|
|
+ },
|
|
|
+ experienceFun(){
|
|
|
+ /**姜枫 2021.04.30 小程序审核体验账号**/
|
|
|
+ postWxCode().then(subRes => {
|
|
|
+ if (util.isEmpty(subRes)) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ uni.setStorageSync('token', subRes.data.token)
|
|
|
+ uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
|
|
|
+ getDictionaries({ token: subRes.data.token }).then(res => {
|
|
|
+ if (util.isEmpty(res)) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ store.commit('setDictionariesInfo', {
|
|
|
+ ...res.data.dict,
|
|
|
+ ...res.data
|
|
|
+ })
|
|
|
+ store.commit('setMyShopInfo', {
|
|
|
+ ...res.data.shop,
|
|
|
+ ...res.data
|
|
|
+ })
|
|
|
+ })
|
|
|
+ store.commit('setLoginInfo', {
|
|
|
+ ...subRes.data.admin,
|
|
|
+ ...subRes.data
|
|
|
+ })
|
|
|
+
|
|
|
+ //启动更新逻辑 shish 2020.5.18
|
|
|
+ if (subRes.data.update == 1) {
|
|
|
+ const updateManager = wx.getUpdateManager()
|
|
|
+ updateManager.onCheckForUpdate(function (res) {
|
|
|
+ // 请求完新版本信息的回调
|
|
|
+ console.log(res.hasUpdate)
|
|
|
+ })
|
|
|
+ updateManager.onUpdateReady(function () {
|
|
|
+ wx.showModal({
|
|
|
+ title: '更新提示',
|
|
|
+ content: '新版本已经准备好,是否重启应用?',
|
|
|
+ success(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
|
+ updateManager.applyUpdate()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ updateManager.onUpdateFailed(function () {})// 新版本下载失败
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ getUser(true);
|
|
|
+ this.setUserShopAll();
|
|
|
+ uni.switchTab({url:'/admin/home/workbench'})
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.jweixinFn({
|
|
|
@@ -135,6 +198,11 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+.experience{
|
|
|
+ //height: 60rpx;
|
|
|
+ padding: 0 30rpx;
|
|
|
+ color: #3385FF;
|
|
|
+}
|
|
|
.header_logo{
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
@@ -152,16 +220,21 @@ export default {
|
|
|
height: 49upx;
|
|
|
// background-color: #eee;
|
|
|
}
|
|
|
- &>.free_register{
|
|
|
- width: 200upx;
|
|
|
- height: 60pux;
|
|
|
- line-height: 60upx;
|
|
|
- background: linear-gradient(90deg, #3385FF, #33B0FF);
|
|
|
- border-radius: 30upx;
|
|
|
- text-align: center;
|
|
|
- font-size: 32px;
|
|
|
- color: #FFFFFF;
|
|
|
- }
|
|
|
+ .header_logo-more{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .free_register{
|
|
|
+ width: 200upx;
|
|
|
+ height: 60pux;
|
|
|
+ line-height: 60upx;
|
|
|
+ background: linear-gradient(90deg, #3385FF, #33B0FF);
|
|
|
+ border-radius: 30upx;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 32px;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
.main{
|
|
|
margin: 100upx 0;
|