|
@@ -10,8 +10,8 @@
|
|
<tabs class="tab-content" onchange="tabbarChange" index="{{current}}">
|
|
<tabs class="tab-content" onchange="tabbarChange" index="{{current}}">
|
|
<tab-content>
|
|
<tab-content>
|
|
<home-page @change="pageSwitch" tabindex="{{current}}"></home-page>
|
|
<home-page @change="pageSwitch" tabindex="{{current}}"></home-page>
|
|
- <category-page tabindex="{{current}}"></category-page>
|
|
|
|
- <shelf-page @change="pageSwitch" tabindex='{{current}}'></shelf-page>
|
|
|
|
|
|
+
|
|
|
|
+ <shelf-page @change="pageSwitch" tabindex="{{current}}"></shelf-page>
|
|
<my-page @customer="openCustomer" tabindex="{{current}}"></my-page>
|
|
<my-page @customer="openCustomer" tabindex="{{current}}"></my-page>
|
|
</tab-content>
|
|
</tab-content>
|
|
</tabs>
|
|
</tabs>
|
|
@@ -27,19 +27,28 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <image src="../../assets/imgs/sign_show.png" class="sign-icon" @click="changeSignPop" if="{{user.is_vip}}" > </image>
|
|
|
|
- <image src="../../assets/imgs/rukou.png" class="sign-icon" @click="goTask" if="{{!user.is_vip}}" > </image>
|
|
|
|
- <sign-page if="{{showSignPop}}"></sign-page>
|
|
|
|
- <short-page if="{{showShortPop}}" @addshort="shortEnd"></short-page>
|
|
|
|
- <div class="stack-popup" @click="closeWrap" if="showPopup">
|
|
|
|
- <div class="customer-popup">
|
|
|
|
- <text class="title">联系客服</text>
|
|
|
|
- <text class="desc">
|
|
|
|
- 复制微信号或者保存二维码到本地至微信添加客服好友
|
|
|
|
- </text>
|
|
|
|
- <image src="{{cutomerQrcode}}" @longpress="saveImg"></image>
|
|
|
|
- <div class="duplication"><text class="duplication-text">微信号:{{cutomerName}}</text><text class="duplication-button" @click="duplication">复制</text></div>
|
|
|
|
|
|
+ <stack>
|
|
|
|
+ <image src="../../assets/imgs/sign_show.png" class="sign-icon" @click="changeSignPop" if="{{user.is_vip}}"> </image>
|
|
|
|
+ <image src="../../assets/imgs/rukou.png" class="sign-icon" @click="goTask" if="{{!user.is_vip && home_show}}"> </image>
|
|
|
|
+
|
|
|
|
+ <sign-page if="{{showSignPop}}"></sign-page>
|
|
|
|
+ <short-page if="{{!showActivitys && showShortPop}}" @addshort="shortEnd"></short-page>
|
|
|
|
+ <div class="stack-popup" @click="closeWrap" if="showPopup">
|
|
|
|
+ <div class="customer-popup">
|
|
|
|
+ <text class="title">联系客服</text>
|
|
|
|
+ <text class="desc">
|
|
|
|
+ 复制微信号或者保存二维码到本地至微信添加客服好友
|
|
|
|
+ </text>
|
|
|
|
+ <image src="{{cutomerQrcode}}" @longpress="saveImg"></image>
|
|
|
|
+ <div class="duplication"><text class="duplication-text">微信号:{{cutomerName}}</text><text class="duplication-button" @click="duplication">复制</text></div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="mask" @click="closeAcitivity" if="{{showActivitys && home_alert}}">
|
|
|
|
+ <image src="{{home_alert.img}}" class="banner" @click="goActicity"></image>
|
|
|
|
+ <image src="../../assets/imgs/pop_close.png" class="close-pop" @click="closeAcitivity"></image>
|
|
</div>
|
|
</div>
|
|
|
|
+ </stack>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</stack>
|
|
</stack>
|
|
</template>
|
|
</template>
|
|
@@ -50,18 +59,20 @@ import prompt from '@system.prompt';
|
|
import device from "@system.device";
|
|
import device from "@system.device";
|
|
import storage from "@system.storage";
|
|
import storage from "@system.storage";
|
|
import it from "../../helper/interface.js";
|
|
import it from "../../helper/interface.js";
|
|
-import { getCustomQrcode, userAddDsktop,getUserInfo} from '../../api/index.js';
|
|
|
|
-import { downImg, getStore } from '../../api/utils.js';
|
|
|
|
|
|
+import { getCustomQrcode, userAddDsktop, getUserInfo } from '../../api/index.js';
|
|
|
|
+import { downImg, getStore, getAppConfig } from '../../api/utils.js';
|
|
import router from "@system.router";
|
|
import router from "@system.router";
|
|
|
|
+let getConfig;
|
|
export default {
|
|
export default {
|
|
- public:{
|
|
|
|
- curPage : 0,
|
|
|
|
|
|
+ public: {
|
|
|
|
+ curPage: 0,
|
|
push_id: ''
|
|
push_id: ''
|
|
},
|
|
},
|
|
protected: {
|
|
protected: {
|
|
current: 0,
|
|
current: 0,
|
|
- user:{}
|
|
|
|
|
|
+ user: {}
|
|
},
|
|
},
|
|
|
|
+ home_alert: [],
|
|
private: {
|
|
private: {
|
|
tabbar: [
|
|
tabbar: [
|
|
{
|
|
{
|
|
@@ -71,69 +82,82 @@ export default {
|
|
active_icon: "../../assets/imgs/home_choose.png",
|
|
active_icon: "../../assets/imgs/home_choose.png",
|
|
index: 0
|
|
index: 0
|
|
},
|
|
},
|
|
- // {
|
|
|
|
- // name: "分类",
|
|
|
|
- // title: "书城",
|
|
|
|
- // icon: "../../assets/imgs/category.png",
|
|
|
|
- // active_icon: "../../assets/imgs/category_choose.png",
|
|
|
|
- // index: 1
|
|
|
|
- // },
|
|
|
|
{
|
|
{
|
|
name: "书架",
|
|
name: "书架",
|
|
title: "我的书架",
|
|
title: "我的书架",
|
|
icon: "../../assets/imgs/shelf.png",
|
|
icon: "../../assets/imgs/shelf.png",
|
|
active_icon: "../../assets/imgs/shelf_choose.png",
|
|
active_icon: "../../assets/imgs/shelf_choose.png",
|
|
- index: 2
|
|
|
|
|
|
+ index: 1
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: "我的",
|
|
name: "我的",
|
|
title: "个人中心",
|
|
title: "个人中心",
|
|
icon: "../../assets/imgs/my.png",
|
|
icon: "../../assets/imgs/my.png",
|
|
active_icon: "../../assets/imgs/my_choose.png",
|
|
active_icon: "../../assets/imgs/my_choose.png",
|
|
- index: 3
|
|
|
|
|
|
+ index: 2
|
|
}
|
|
}
|
|
],
|
|
],
|
|
// current: 0,
|
|
// current: 0,
|
|
showPopup: false,
|
|
showPopup: false,
|
|
|
|
+ showActivitys: false,
|
|
showSignPop: false,
|
|
showSignPop: false,
|
|
- showShortPop: false,
|
|
|
|
- cutomerQrcode: '',
|
|
|
|
- cutomerName: '',
|
|
|
|
- brand:''
|
|
|
|
|
|
+ home_show: 0,
|
|
|
|
+ home_alert:null
|
|
},
|
|
},
|
|
async onInit() {
|
|
async onInit() {
|
|
this.$on('dispathEvt', this.changeSignPop);
|
|
this.$on('dispathEvt', this.changeSignPop);
|
|
this.$watch('current', 'watchCurrent');
|
|
this.$watch('current', 'watchCurrent');
|
|
- if(this.push_id){
|
|
|
|
- await storage.set({ key: "push_id", value: this.push_id });
|
|
|
|
|
|
+ this.showActivity();
|
|
|
|
+ if (this.push_id) {
|
|
|
|
+ await storage.set({ key: "push_id", value: this.push_id });
|
|
}
|
|
}
|
|
//今日已签到过不在弹框签到
|
|
//今日已签到过不在弹框签到
|
|
this.getCoustom();
|
|
this.getCoustom();
|
|
this.getUser();
|
|
this.getUser();
|
|
- if(this.curPage && this.curPage > 0 ){
|
|
|
|
|
|
+ if (this.curPage && this.curPage > 0) {
|
|
this.current = this.curPage
|
|
this.current = this.curPage
|
|
}
|
|
}
|
|
|
|
+ getConfig = getAppConfig(this);
|
|
|
|
+ let { home_show } = await getConfig('task_center');
|
|
|
|
+ this.home_show = home_show;
|
|
|
|
+ let { home_alert } = await getConfig('position');
|
|
|
|
+ if(home_alert.length>0){
|
|
|
|
+ this.home_alert = home_alert[0];
|
|
|
|
+ this.showActivitys = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
-
|
|
|
|
|
|
+ },
|
|
|
|
+ goActicity(){
|
|
|
|
+ router.push({
|
|
|
|
+ uri: '/views/Activity',
|
|
|
|
+ params:this.home_alert.params
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ showActivity() {
|
|
|
|
+ this.showActivitys = 1;
|
|
|
|
+ },
|
|
|
|
+ closeAcitivity() {
|
|
|
|
+ this.showActivitys = 0;
|
|
},
|
|
},
|
|
async onShow() {
|
|
async onShow() {
|
|
const data = this.$app.getAppData('backfrom');
|
|
const data = this.$app.getAppData('backfrom');
|
|
let device_info = (await device.getInfo()).data;
|
|
let device_info = (await device.getInfo()).data;
|
|
- this.brand = device_info.brand ;
|
|
|
|
- if(data=='phone'){
|
|
|
|
- this.current = 1;
|
|
|
|
- this.$app.setAppData('backfrom','');
|
|
|
|
|
|
+ this.brand = device_info.brand;
|
|
|
|
+ if (data == 'phone') {
|
|
|
|
+ this.current = 0;
|
|
|
|
+ this.$app.setAppData('backfrom', '');
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
it.getShortCut((value) => {
|
|
it.getShortCut((value) => {
|
|
this.showShortPop = !value;
|
|
this.showShortPop = !value;
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
shortEnd(value) {
|
|
shortEnd(value) {
|
|
if (value.detail.msg) {
|
|
if (value.detail.msg) {
|
|
prompt.showToast({ message: "用户禁止创建" });
|
|
prompt.showToast({ message: "用户禁止创建" });
|
|
- }else if(value.detail.installed){
|
|
|
|
|
|
+ } else if (value.detail.installed) {
|
|
prompt.showToast({ message: "添加桌面成功!请前往任务中心领取奖励" });
|
|
prompt.showToast({ message: "添加桌面成功!请前往任务中心领取奖励" });
|
|
}
|
|
}
|
|
this.showShortPop = !value.detail.installed;
|
|
this.showShortPop = !value.detail.installed;
|
|
@@ -142,18 +166,18 @@ export default {
|
|
console.log("watching", i);
|
|
console.log("watching", i);
|
|
this.current = i;
|
|
this.current = i;
|
|
},
|
|
},
|
|
- async getUser(){
|
|
|
|
|
|
+ async getUser() {
|
|
let user = await getUserInfo();
|
|
let user = await getUserInfo();
|
|
this.user = user;
|
|
this.user = user;
|
|
},
|
|
},
|
|
- goTask(){
|
|
|
|
|
|
+ goTask() {
|
|
router.push({
|
|
router.push({
|
|
uri: '/views/Task'
|
|
uri: '/views/Task'
|
|
})
|
|
})
|
|
},
|
|
},
|
|
onBackPress() {
|
|
onBackPress() {
|
|
// 退出逻辑
|
|
// 退出逻辑
|
|
- if (this.$app.$def.data.backClickCount === 0 && this.brand!=='vivo') {
|
|
|
|
|
|
+ if (this.$app.$def.data.backClickCount === 0 && this.brand !== 'vivo') {
|
|
this.$app.$def.data.backClickCount++;
|
|
this.$app.$def.data.backClickCount++;
|
|
this.$app.$def.createShortcut();
|
|
this.$app.$def.createShortcut();
|
|
return true;
|
|
return true;
|
|
@@ -170,10 +194,10 @@ export default {
|
|
this.showShortPop = false;
|
|
this.showShortPop = false;
|
|
},
|
|
},
|
|
async getCoustom() {
|
|
async getCoustom() {
|
|
- userAddDsktop(this.$app.$def.data.backClickCount).then(res=>{
|
|
|
|
|
|
+ userAddDsktop(this.$app.$def.data.backClickCount).then(res => {
|
|
//TODO 加桌后统计上报
|
|
//TODO 加桌后统计上报
|
|
- }).catch(r=>{
|
|
|
|
- //TODO 失败后统计上报
|
|
|
|
|
|
+ }).catch(r => {
|
|
|
|
+ //TODO 失败后统计上报
|
|
});
|
|
});
|
|
let res = await getCustomQrcode();
|
|
let res = await getCustomQrcode();
|
|
this.cutomerQrcode = res.url;
|
|
this.cutomerQrcode = res.url;
|
|
@@ -181,10 +205,11 @@ export default {
|
|
},
|
|
},
|
|
tabbarChange(tab) {
|
|
tabbarChange(tab) {
|
|
this.current = tab.index;
|
|
this.current = tab.index;
|
|
- this.$page.setTitleBar({ text: this.tabbar[tab.index].title });
|
|
|
|
|
|
+
|
|
|
|
+ //this.$page.setTitleBar({ text: this.tabbar[tab.index].title });
|
|
},
|
|
},
|
|
pageSwitch() {
|
|
pageSwitch() {
|
|
- this.current = 1;
|
|
|
|
|
|
+ this.current = 0;
|
|
},
|
|
},
|
|
changeSignPop() {
|
|
changeSignPop() {
|
|
this.showSignPop = !this.showSignPop;
|
|
this.showSignPop = !this.showSignPop;
|