Commit 05f128ba authored by 刘文虎's avatar 刘文虎

bug修复

parent 73835638
...@@ -7,3 +7,12 @@ export function getList(data) { ...@@ -7,3 +7,12 @@ export function getList(data) {
noLoading:true noLoading:true
}) })
} }
export function addSubscribeCount(data) {
return request({
url: `/rest/trip/subscribe`,
method: 'PUT',
data,
noLoading:true
})
}
...@@ -34,10 +34,18 @@ export function add(data) { ...@@ -34,10 +34,18 @@ export function add(data) {
}) })
} }
export function deleteByIds(data) { export function deleteById(data) {
return request({ return request({
url: `/rest/trip/delete`, url: `/rest/trip/delete`,
method: 'POST', method: 'POST',
data data
}) })
} }
export function saveTripSubscribe(data) {
return request({
url: `/rest/trip/subscribe`,
method: 'POST',
data
})
}
\ No newline at end of file
...@@ -62,6 +62,7 @@ import upload from '@/utils/upload'; ...@@ -62,6 +62,7 @@ import upload from '@/utils/upload';
import { getBillTypes, add } from '@/api/bill/daily.js'; import { getBillTypes, add } from '@/api/bill/daily.js';
import { get } from '@/api/bill/index.js'; import { get } from '@/api/bill/index.js';
import { getQiNiuToken } from '@/api/upload/index.js'; import { getQiNiuToken } from '@/api/upload/index.js';
import {mapGetters} from "vuex"
export default { export default {
name: 'billing-daily', name: 'billing-daily',
components: { components: {
...@@ -127,6 +128,9 @@ export default { ...@@ -127,6 +128,9 @@ export default {
notification : 'update-payments-setting' notification : 'update-payments-setting'
}; };
}, },
computed:{
...mapGetters(['billType']),
},
mounted() { mounted() {
this.init(); this.init();
}, },
...@@ -136,6 +140,7 @@ export default { ...@@ -136,6 +140,7 @@ export default {
methods: { methods: {
init() { init() {
this.form.happenTime = this.parseTime(new Date(), '{y}-{m}-{d}'); this.form.happenTime = this.parseTime(new Date(), '{y}-{m}-{d}');
this.form.type=this.billType
if(checkToken()){ if(checkToken()){
this.getBillTypeOptions(); this.getBillTypeOptions();
this.getQiniuToken(); this.getQiniuToken();
...@@ -204,6 +209,7 @@ export default { ...@@ -204,6 +209,7 @@ export default {
longitude: '' longitude: ''
}; };
this.form.happenTime = this.parseTime(new Date(), '{y}-{m}-{d}'); this.form.happenTime = this.parseTime(new Date(), '{y}-{m}-{d}');
this.form.type=this.billType
if(this.billingCategoryList.length){ if(this.billingCategoryList.length){
this.form.classificationId = this.billingCategoryList[0]&&this.billingCategoryList[0][0].id||''; this.form.classificationId = this.billingCategoryList[0]&&this.billingCategoryList[0][0].id||'';
} }
...@@ -263,11 +269,13 @@ export default { ...@@ -263,11 +269,13 @@ export default {
try { try {
await add(this.form); await add(this.form);
this.showToast(title + '成功', true); this.showToast(title + '成功', true);
this.$store.dispatch('Save_bill_type',this.form.type)
setTimeout(() => { setTimeout(() => {
this.show = false; this.show = false;
this.$emit('afterSave'); this.$emit('afterSave');
}, 1500); }, 1500);
} catch (error) { } catch (error) {
console.log(error)
let {msg}=error let {msg}=error
if(msg){ if(msg){
this.showToast(msg); this.showToast(msg);
......
...@@ -236,6 +236,15 @@ ...@@ -236,6 +236,15 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}
,{
"path" : "user-setting/user-setting",
"style" :
{
"navigationBarTitleText": "个人设置",
"enablePullDownRefresh": false
}
} }
] ]
}, },
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<view class="item" v-for="(item, index) in list" :key="index"> <view class="item" v-for="(item, index) in list" :key="index">
<view class="item-label">{{ item.label }}</view> <view class="item-label">{{ item.label }}</view>
<view class="item-value"> <view class="item-value">
<text class="item-value-repair" v-if="item.value === 'remark' && detail.repairId">点击查看维修账单</text> <text class="item-value-repair" v-if="item.value === 'remark' && detail.repairId" @click="toRepair">点击查看维修账单</text>
<text v-else>{{ detail[item.value] || '' }}</text> <text v-else-if="item.value === 'happenTime'">{{ resetHappenTime(detail[item.value]) || '' }}</text>
</view> </view>
</view> </view>
<view class="card-bdoy-images" v-if="detail.attach"> <view class="card-bdoy-images" v-if="detail.attach">
...@@ -130,10 +130,18 @@ export default { ...@@ -130,10 +130,18 @@ export default {
}, },
toEdit() { toEdit() {
if (this.detail.repairId) { if (this.detail.repairId) {
uni.navigateTo({
url: `/pages/maintain-bill/create?billId=${this.detail.repairId}`
});
} else { } else {
this.$refs['billing-daily'].open(this.detail.id); this.$refs['billing-daily'].open(this.detail.id);
} }
}, },
toRepair(){
uni.navigateTo({
url: `/pages/maintain-bill/detail?billId=${this.detail.repairId}`
});
},
async handleConfirm() { async handleConfirm() {
try { try {
let params = { let params = {
...@@ -177,6 +185,16 @@ export default { ...@@ -177,6 +185,16 @@ export default {
} }
} }
}); });
},
resetHappenTime(time){
if(!time){
return ''
}
if(this.detail.repairId){
return time
}else{
return this.parseTime(time,'{y}-{m}-{d}')
}
} }
} }
}; };
......
<template> <template>
<view class="debit-detail"> <view class="debit-detail" @click="toBill">
<view class="content"> <view class="content">
<view class="content-item"> <view class="content-item">
<text class="content-item-label">客户名称:</text> <text class="content-item-label">客户名称:</text>
...@@ -45,6 +45,13 @@ export default { ...@@ -45,6 +45,13 @@ export default {
}, },
data() { data() {
return {}; return {};
},
methods:{
toBill(){
this.$route.push({
path:"/pages/maintain-bill/index"
})
}
} }
}; };
</script> </script>
......
...@@ -71,20 +71,7 @@ export default { ...@@ -71,20 +71,7 @@ export default {
keyword: '' keyword: ''
}, },
list: [ list: [
[ [],
{
name: '王先生',
phone: '13598489568',
status: '1',
money: '1000.00'
},
{
name: '王先生',
phone: '13598489568',
status: '0',
money: '1000.00'
}
],
[], [],
[] []
], ],
......
...@@ -18,7 +18,11 @@ import NoData from '@/components/no-data'; ...@@ -18,7 +18,11 @@ import NoData from '@/components/no-data';
import PlanStep from './plan-step.vue'; import PlanStep from './plan-step.vue';
import subscribeMixin from '@/utils/subscribeMixin'; import subscribeMixin from '@/utils/subscribeMixin';
import { getTime } from '@/utils/common.js'; import { getTime } from '@/utils/common.js';
import { getList } from '@/api/schedule/index.js'; import { getList,saveTripSubscribe } from '@/api/schedule/index.js';
import {
getChannel
} from "@/utils/common.js"
export default { export default {
name: 'plan-view', name: 'plan-view',
...@@ -84,12 +88,28 @@ export default { ...@@ -84,12 +88,28 @@ export default {
} }
try{ try{
await this.getSubscribeMessage(this.scene.trip); // 拉起订阅 await this.getSubscribeMessage(this.scene.trip); // 拉起订阅
this.showToast('订阅成功'); this.saveSubscribe(item)
}catch(e){ }catch(e){
//TODO handle the exception //TODO handle the exception
console.log(e)
} }
}, },
// 提交行程订阅给服务器
async saveSubscribe(item) {
try {
let params = {
id: item.id,
loginChannel: getChannel().loginChannel,
authType:getChannel().authType
}
let res = await saveTripSubscribe(params);
this.showToast('订阅成功');
} catch (e) {
//TODO handle the exception
console.log(e)
}
},
handleClick(item) { handleClick(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/schedule/schedule-detail/schedule-detail?id=${item.id}` url: `/pages/schedule/schedule-detail/schedule-detail?id=${item.id}`
......
...@@ -8,9 +8,8 @@ export default { ...@@ -8,9 +8,8 @@ export default {
return { return {
content: '', content: '',
webUrl:"", webUrl:"",
protocol:"http://www.weixiuhui.cn/protocol.html",//用户协议 protocol:"https://api-book.kaying.cc/protocol.html",//用户协议
policy:"http://www.weixiuhui.cn/policy.html",//隐私政策 policy:"https://api-book.kaying.cc/policy.html",//隐私政策
}; };
}, },
onLoad(options) { onLoad(options) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="update-log-item" :class="{active:checked}"> <view class="update-log-item" :class="{active:checked}">
<view class="head"> <view class="head">
<view class="head-title">{{detail.title}}</view> <view class="head-title">{{detail.title}}</view>
<view class="head-time">{{detail.createdTime}}</view> <view class="head-time">{{detail.createTime}}</view>
</view> </view>
<view class="content">{{detail.content}}</view> <view class="content">{{detail.content}}</view>
</view> </view>
......
...@@ -38,7 +38,7 @@ export default { ...@@ -38,7 +38,7 @@ export default {
}, },
data() { data() {
return { return {
records: [], list: [],
loaded: false, loaded: false,
current: 0, current: 0,
size: 10, size: 10,
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
}, },
computed: { computed: {
noData() { noData() {
return (this.records || []).length == 0 && this.loaded; return (this.list || []).length == 0 && this.loaded;
} }
}, },
mounted() { mounted() {
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
}, },
async getList() { async getList() {
if (this.current == 0) { if (this.current == 0) {
this.records = []; this.list = [];
this.loaded = false; this.loaded = false;
} }
try { try {
...@@ -77,9 +77,9 @@ export default { ...@@ -77,9 +77,9 @@ export default {
let res = await getList(params); let res = await getList(params);
let { records, total } = res.data; let { records, total } = res.data;
if (records) { if (records) {
this.records.push(...records); this.list.push(...records);
// 更新底部加载状态 // 更新底部加载状态
this.loadStatus = total > this.records.length ? 'loadmore' : 'nomore'; this.loadStatus = total > this.list.length ? 'loadmore' : 'nomore';
} }
this.$nextTick(() => { this.$nextTick(() => {
if (this.freshing) { if (this.freshing) {
...@@ -89,10 +89,15 @@ export default { ...@@ -89,10 +89,15 @@ export default {
}); });
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
this.loadStatus='loadmore'
console.log('error', e); console.log('error', e);
this.$nextTick(() => {
if (this.freshing) {
this.triggered = false; this.triggered = false;
this.freshing = false; this.freshing = false;
} }
});
}
this.loaded = true; this.loaded = true;
}, },
onRefresh() { onRefresh() {
......
<template>
<view class="manage-view">
<NavbarNormal :background="{ background: '#F6F7FA' }" title="营地管理" titleColor="#191C27" :border-bottom="false" title-bold></NavbarNormal>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item title="营地头像" @click="handleClickLogoImage" :title-style="titleStyle" :value-style="valueStyle" :arrow="false">
<u-avatar slot="right-icon" class="avatar-iamge" :src="info.logoUrl ? info.logoUrl : logoImage" size="120"></u-avatar>
<u-icon slot="right-icon" color="#D8D8D8" size="24" name="play-right-fill"></u-icon>
</u-cell-item>
<u-cell-item title="营地名称" :value="info.campName" @click="handleClickChangeName" :title-style="titleStyle" :value-style="valueStyle" :arrow="false">
<u-icon slot="right-icon" color="#D8D8D8" size="24" name="play-right-fill"></u-icon>
</u-cell-item>
<u-cell-item title="封面图片" @click="handleClickCoverImage" :title-style="titleStyle" :value-style="valueStyle" :arrow="false">
<u-image slot="right-icon" width="160" height="120" mode="aspectFill" :src="info.coverUrl ? info.coverUrl : backgroundImage" :border-radius="8"></u-image>
<u-icon slot="right-icon" color="#D8D8D8" size="24" name="play-right-fill"></u-icon>
</u-cell-item>
<u-cell-item title="营地介绍" @click="handleClickChangeDesc()" :title-style="titleStyle" :arrow="false">
<view class="desc-box">
<text class="desc-style">{{ info.description }}</text>
</view>
<u-icon slot="right-icon" color="#D8D8D8" size="24" name="play-right-fill"></u-icon>
</u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item @click="$u.throttle(handleClickGroup, 500)" title="分组管理" :title-style="titleStyle" :value-style="valueStyle" :arrow="false">
<u-icon slot="right-icon" color="#D8D8D8" size="24" name="play-right-fill"></u-icon>
</u-cell-item>
<u-cell-item @click="$u.throttle(handleClickAdmin, 500)" title="管理员设置" :title-style="titleStyle" :value-style="valueStyle" :arrow="false">
<u-icon slot="right-icon" color="#D8D8D8" size="24" name="play-right-fill"></u-icon>
</u-cell-item>
<u-cell-item title="成员列表公开" :title-style="titleStyle" hover-class="none" :value-style="valueStyle" :arrow="false">
<u-switch
slot="right-icon"
v-model="info.memberOpen"
active-color="#FFDE00"
inactive-color="#8D8D8D"
:loading="switchLoading"
@change="handleChangeMemberOpen"
></u-switch>
</u-cell-item>
</u-cell-group>
</view>
<view class="u-m-t-20">
<u-cell-group>
<u-cell-item title="加入设置" @click="handleClickChangeJoin" :title-style="titleStyle" :value-style="valueStyle" :arrow="false">
<u-icon slot="right-icon" color="#D8D8D8" size="24" name="play-right-fill"></u-icon>
</u-cell-item>
<u-cell-item title="禁言/黑名单" @click="handleClickBrig" :title-style="titleStyle" :value-style="valueStyle" :arrow="false">
<u-icon slot="right-icon" color="#D8D8D8" size="24" name="play-right-fill"></u-icon>
</u-cell-item>
</u-cell-group>
</view>
<view class="bottom-view u-m-t-20" v-if="isCampOwner"><view class="dissolve" @click="handleClickNew">解散营地</view></view>
<PopImage :visible.sync="showLogoImage" :buttonText="buttonText" :image="info.logoUrl" @click="handleClickChangeImage" />
<PopImage :visible.sync="showCoverImage" :buttonText="buttonText" :image="info.coverUrl ? info.coverUrl : backgroundImage" @click="handleClickChangeImage" />
<PopInput title="解散营地" type="text" sureText="确定" :content="contentText" :visible.sync="showConfirm" @click="handleConfirm" />
</view>
</template>
<script>
import PopImage from '@/components/pop-image';
import PopInput from '@/components/pop-input-view';
import upload from '@/utils/upload';
import NavbarNormal from '@/components/navbar-normal';
export default {
components: {
PopImage,
NavbarNormal,
PopInput
},
data() {
return {
info: {}, // 营地信息
showLogoImage: false,
showCoverImage: false,
showConfirm: false,
currentOperate: 'logo',
qiniuToken: '',
needRefresh: true,
role: '',
switchLoading: false,
contentText: '解散营地后无法恢复,确认解散?'
};
},
computed: {
buttonText() {
return this.currentOperate == 'cover' ? '更换背景' : '更换营地头像';
},
baseUrl() {
return process.uniEnv.qn_base_url;
},
logoImage() {
return process.uniEnv.qn_base_url + 'morenyingditouxiang-k@3x.png';
},
backgroundImage() {
return process.uniEnv.qn_base_url + 'morenyingditupian@3x.png';
},
assetUrl() {
return process.uniEnv.qn_asset_url;
},
chatImage() {
return process.uniEnv.qn_base_url + 'pinglun@3x.png';
},
titleStyle() {
return {
fontSize: '28rpx',
color: '#8D8D8D'
};
},
valueStyle() {
return {
fontSize: '28rpx',
color: '#333',
marginRight: '16rpx'
};
},
descStyle() {
return {};
},
isCampOwner() {
return this.role == 'CAMPOWNER' || this.info.campOwnerId == this.user_info.id;
}
},
onLoad(options) {
if (options && options.role) {
this.role = options.role;
}
// 测试数据
// this.role == 'CAMPOWNER'
this.getQiniuToken();
uni.hideShareMenu();
},
onShow() {
if (this.needRefresh) {
this.getCampInfo();
}
this.needRefresh = true;
},
methods: {
handleClickChangeJoin() {
this.$u.route({
url: '/pages/camp/editJoin',
params: {
value: this.info.joinCondition && this.info.joinCondition.code
}
});
},
handleClickAdmin() {
this.$u.route({
url: '/pages/command/admins'
});
},
handleClickBrig() {
this.$u.route({
url: '/pages/command/brig'
});
},
handleClickChangeName() {
this.$u.route({
url: '/pages/camp/input',
params: {
type: 'camp',
value: encodeURIComponent(this.info.campName)
}
});
uni.$once('input-sure-camp', res => {
this.info.campName = res.content;
this.updateCamp({
campName: res.content,
id: this.camp_id
});
});
},
handleClickChangeDesc() {
this.needRefresh = false;
this.$u.route({
url: '/pages/camp/input',
params: {
type: 'camp-introduce',
value: encodeURIComponent(this.info.description)
}
});
uni.$once('input-sure-camp-introduce', res => {
this.info.description = res.content;
this.updateCamp({
description: res.content,
id: this.camp_id
});
});
},
getQiniuToken() {
this.$u.api.getQiNiuToken().then(res => {
this.qiniuToken = res;
});
},
handleClickLogoImage() {
this.currentOperate = 'logo';
this.showLogoImage = true;
},
handleClickCoverImage() {
this.currentOperate = 'cover';
this.showCoverImage = true;
},
getCampInfo() {
this.$u.api
.getCampInfo({
campId: this.camp_id
})
.then(res => {
this.info = res || {};
})
.catch(err => {
console.log(err);
});
},
toUrl(url) {
this.$u.route(url);
},
handleChangeMemberOpen(val) {
this.switchLoading = true;
this.updateCamp({
memberOpen: this.info.memberOpen,
id: this.camp_id
});
},
// updateCamp(param) {
// this.$u.api
// .updateCamp(param)
// .then((res) => {
// console.log('menu:', res)
// })
// .catch((err) => {
// console.log(err)
// })
// },
handleClickChangeImage() {
// 上传图片
upload.getPhoto(this.qiniuToken).then(res => {
console.log('upload success', res);
let param = {
id: this.camp_id
};
switch (this.currentOperate) {
case 'cover':
this.info.coverUrl = this.assetUrl + res.key;
param.coverUrl = this.info.coverUrl;
break;
case 'logo':
this.info.logoUrl = this.assetUrl + res.key;
param.logoUrl = this.info.logoUrl;
break;
}
this.updateCamp(param);
});
},
handleClickGroup() {
this.$u.route({
url: '/pages/command/groups'
});
},
updateCamp(param) {
this.$u.api
.updateCamp(param)
.then(res => {
this.switchLoading = false;
console.log('menu:', res);
})
.catch(err => {
console.log(err);
});
},
handleClickNew() {
this.showConfirm = true;
},
async handleConfirm() {
uni.showLoading({
mask: true
});
try {
let res = await this.$u.api.dissolutionCampByCampModules(this.camp_id);
if (res) {
this.showConfirm = false;
uni.showToast({
icon: 'success',
mask: true,
duration: 1500,
title: '解散成功'
});
this.$u.vuex('camp_id', '')
setTimeout(() => {
this.$u.route({
type: 'switchTab',
url: 'pages/index/index'
});
}, 1500);
}
} catch (e) {
//TODO handle the exception
}
}
}
};
</script>
<style scoped lang="scss">
.manage-view {
background-color: #f6f7fa;
display: flex;
flex-direction: column;
height: 100vh;
font-size: 26rpx;
overflow: auto;
.desc-box {
width: 100%;
display: flex;
justify-content: flex-end;
text-align: left;
}
.desc-style {
margin-left: 32rpx;
overflow: hidden;
word-break: break-all;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
fontsize: 28rpx;
color: #333;
margin-right: 16rpx;
}
.avatar-iamge {
margin-right: 16rpx;
background-color: #f6f7fa;
border-radius: 50%;
}
.bottom-view {
text-align: center;
background: #fff;
padding: 48rpx 0;
.dissolve {
font-size: 28rpx;
font-weight: bold;
color: #fc524d;
}
}
}
</style>
...@@ -59,6 +59,7 @@ export default { ...@@ -59,6 +59,7 @@ export default {
return { return {
scheduleSettingOptions, scheduleSettingOptions,
myFilter, myFilter,
showConfirm:false,
id: '', id: '',
detail: { detail: {
name: '', name: '',
...@@ -120,19 +121,22 @@ export default { ...@@ -120,19 +121,22 @@ export default {
this.showConfirm = true; this.showConfirm = true;
}, },
async handleConfirm() { async handleConfirm() {
if (!this.form.id) { if (!this.detail.id) {
this.showToast('行程不存在'); this.showToast('行程不存在');
return false; return false;
} }
try { try {
await deleteById({ await deleteById({
id:this.form.id id:this.detail.id
}); });
this.showToast('删除成功', true); this.showToast('删除成功', true);
setTimeout(() => { setTimeout(() => {
this.navigateTo(); uni.navigateBack({
delta:1
})
}, 1500); }, 1500);
} catch (e) { } catch (e) {
console.log(e)
//TODO handle the exception //TODO handle the exception
} }
} }
......
...@@ -8,5 +8,6 @@ const getters = { ...@@ -8,5 +8,6 @@ const getters = {
autoLogin:state=>state.login.autoLogin, autoLogin:state=>state.login.autoLogin,
quotedPriceTooltip:state=>state.common.quotedPriceTooltip, quotedPriceTooltip:state=>state.common.quotedPriceTooltip,
cdKeySetting:state=>state.common.cdKeySetting, cdKeySetting:state=>state.common.cdKeySetting,
billType:state=>state.bill.billType,
} }
export default getters export default getters
...@@ -2,6 +2,7 @@ import Vue from 'vue' ...@@ -2,6 +2,7 @@ import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import login from './modules/login' import login from './modules/login'
import common from './modules/common' import common from './modules/common'
import bill from './modules/bill'
import getters from './getters' import getters from './getters'
...@@ -11,6 +12,7 @@ const store = new Vuex.Store({ ...@@ -11,6 +12,7 @@ const store = new Vuex.Store({
modules: { modules: {
login, login,
common, common,
bill
}, },
getters getters
}) })
......
import {
setBillType,
getBillType,
} from "@/utils/common.js"
const state = {
billType: getBillType()||'INCOME',
}
const mutations = {
SAVE_BILL_TYPE: (state, data) => {
state.billType = data
setBillType(data)
},
}
const actions = {
Save_bill_type:({
state,
commit
},data) => {
commit("SAVE_BILL_TYPE", data)
},
}
export default {
state,
mutations,
actions
}
...@@ -152,22 +152,36 @@ export default { ...@@ -152,22 +152,36 @@ export default {
this.selectDate = JSON.parse(JSON.stringify(dates)); this.selectDate = JSON.parse(JSON.stringify(dates));
}, },
initSign() { initSign() {
this.allDataArr.map(item => { // this.allDataArr.map(item2 => {
item.map(el => { // item2.map(el => {
// let { sYear, sMonth, day } = el;
// this.$set(el, 'daySign', null);
// this.$set(el, 'pastTime',false);
// });
// });
this.allDataArr.map(item2 => {
item2.map(el => {
let { sYear, sMonth, day } = el; let { sYear, sMonth, day } = el;
this.$set(el, 'daySign', null);
this.$set(el, 'pastTime',false);
this.signList.map(item => { this.signList.map(item => {
let sY = new Date(item.date).getFullYear(); let sY = new Date(item.date).getFullYear();
let sM = new Date(item.date).getMonth() + 1; let sM = new Date(item.date).getMonth() + 1;
let sD = new Date(item.date).getDate(); let sD = new Date(item.date).getDate();
if (sY == sYear && sM == sMonth && sD == day) { if (sY == sYear && sM == sMonth && sD == day) {
console.log(item)
this.$set(el, 'daySign', item); this.$set(el, 'daySign', item);
let today = getTime(parseTime(new Date(),'{y}-{m}-{d}')); let today = getTime(parseTime(new Date(),'{y}-{m}-{d}'));
let target = getTime(item.date); let target = getTime(item.date);
this.$set(el, 'pastTime', target < today ? true : false); this.$set(el, 'pastTime', target < today ? true : false);
} }
}); });
}); });
}); });
console.log(this.allDataArr)
}, },
chooseMonth(e) { chooseMonth(e) {
let { value } = e.detail; let { value } = e.detail;
......
...@@ -82,6 +82,13 @@ export function getAutoLogin() { ...@@ -82,6 +82,13 @@ export function getAutoLogin() {
return uni.getStorageSync("AUTOLOGIN")||false return uni.getStorageSync("AUTOLOGIN")||false
} }
export function setBillType(data) {
uni.setStorageSync("BILLTYPE", data);
}
export function getBillType() {
return uni.getStorageSync("BILLTYPE")||''
}
export function checkLoginAndVip(callback){ export function checkLoginAndVip(callback){
if(checkToken()){ if(checkToken()){
...@@ -403,8 +410,9 @@ export const getTime = function(time) { ...@@ -403,8 +410,9 @@ export const getTime = function(time) {
if (isiOS) { if (isiOS) {
if (typeof(time) === "string") { if (typeof(time) === "string") {
t = new Date(time.replace(/-/g, '/')).getTime(); t = new Date(time.replace(/-/g, '/')).getTime();
} }else{
t = myDate.getTime(); t = myDate.getTime();
}
} else { } else {
t = myDate.getTime(); t = myDate.getTime();
} }
......
...@@ -34,20 +34,20 @@ export const serviceTypeOptions = [{ ...@@ -34,20 +34,20 @@ export const serviceTypeOptions = [{
icon:"baojiabaoyang@3x.png" icon:"baojiabaoyang@3x.png"
}, },
{ // {
value: "MJ", // value: "MJ",
label: "美家服务", // label: "美家服务",
icon:"baojiameijia@3x.png" // icon:"baojiameijia@3x.png"
}, // },
{ // {
value: "CL", // value: "CL",
label: "上门测量", // label: "上门测量",
icon:"baojiaceliang@3x.png" // icon:"baojiaceliang@3x.png"
}, // },
{ // {
value: "HS", // value: "HS",
label: "旧机回收", // label: "旧机回收",
icon:"baojiahuishou@3x.png" // icon:"baojiahuishou@3x.png"
}, // },
] ]
\ No newline at end of file
/** 自定义组件 共同逻辑 */ /** 自定义组件 共同逻辑 */
import {sceneOptions,} from "@/utils/config.js" import {
import {getList} from "@/api/mine/subscribe.js" sceneOptions,
import { mapGetters } from 'vuex'; } from "@/utils/config.js"
import {
getList,
addSubscribeCount
} from "@/api/mine/subscribe.js"
import {
mapGetters
} from 'vuex';
export default { export default {
data() { data() {
return { return {
scene:sceneOptions, scene: sceneOptions,
} }
}, },
computed: { computed: {
...@@ -21,32 +29,34 @@ export default { ...@@ -21,32 +29,34 @@ export default {
* scene : 场景值 * scene : 场景值
*/ */
getSubscribeMessage(scene) { getSubscribeMessage(scene) {
return new Promise(async(resolve,reject)=>{ return new Promise(async (resolve, reject) => {
let params={ let params = {
channel:this.loginChannel, channel: this.loginChannel,
scene:scene scene: scene
} }
try{ try {
let {data} = await getList(params); let {
this.requestSubscribeMessage(data,resolve,reject) data
}catch(e){ } = await getList(params);
this.requestSubscribeMessage(data, resolve, reject)
} catch (e) {
//TODO handle the exception //TODO handle the exception
reject(e) reject(e)
} }
}) })
}, },
requestSubscribeMessage(tempList, resolve,reject) { requestSubscribeMessage(tempList, resolve, reject) {
let tmplIds = tempList.map(item => item.outTempleId); let tmplIds = tempList.map(item => item.outTempleId);
uni.requestSubscribeMessage({ uni.requestSubscribeMessage({
tmplIds: tmplIds, tmplIds: tmplIds,
success: res => { success: res => {
console.log(res); console.log(res);
this.saveSubscribeCount(tempList, res, resolve); this.saveSubscribeCount(tempList, res, resolve, reject);
}, },
fail:err=> { fail: err => {
uni.showToast({ uni.showToast({
icon:'none', icon: 'none',
title: '订阅失败' title: '订阅失败'
}); });
console.log(err) console.log(err)
...@@ -54,7 +64,7 @@ export default { ...@@ -54,7 +64,7 @@ export default {
} }
}); });
}, },
saveSubscribeCount(tempList, res, callback) { saveSubscribeCount(tempList, res, resolve, reject) {
let countList = []; let countList = [];
let rejectList = []; let rejectList = [];
if (tempList && res && tempList.length) { if (tempList && res && tempList.length) {
...@@ -67,21 +77,25 @@ export default { ...@@ -67,21 +77,25 @@ export default {
}); });
} }
console.log(`发起 ${tempList.length} 项订阅 , 用户同意订阅 ${countList.length} 项 , 拒绝 ${rejectList.length} 项`); console.log(`发起 ${tempList.length} 项订阅 , 用户同意订阅 ${countList.length} 项 , 拒绝 ${rejectList.length} 项`);
// if (countList.length) { if (countList.length) {
// this.addCount(countList,callback); // this.addCount(countList, resolve, reject);
// } else { resolve(tempList)
// this.onCallback(callback) } else {
// } reject(res)
resolve(res) }
}, },
async addCount(tempList, callback){ async addCount(tempList, resolve, reject) {
try{ try {
let params = tempList.map(item => item.id); let params = {
let res = await addSubscribeCount(this.camp_id, params); templeId: tempList.map(item => item.id),
this.onCallback(callback) loginChannel: getChannel().loginChannel,
}catch(e){ authType:getChannel().authType
}
let res = await addSubscribeCount(params);
resolve(res)
} catch (e) {
//TODO handle the exception //TODO handle the exception
this.onCallback(callback) reject(e)
} }
} }
} }
......
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