Commit d19e6da3 authored by Facius's avatar Facius
parents 2233c801 a2cf3ed0
Pipeline #2940 canceled with stages
...@@ -46,6 +46,7 @@ export async function repairExport(data) { ...@@ -46,6 +46,7 @@ export async function repairExport(data) {
url: `/rest/repair/export`, url: `/rest/repair/export`,
method: 'POST', method: 'POST',
data, data,
responseType:'ArrayBuffer',
noLoading: true noLoading: true
}) })
} }
......
import request from "@/utils/request.js"
export function getList(data) {
return request({
url: `/rest/subscribe/temple`,
method: 'GET',
data,
noLoading:true
})
}
<template> <template>
<u-popup v-model="show" border-radius="24" :custom-style="{ 'background-color': '#F6F7FA' }" safe-area-inset-bottom mode="bottom"> <u-popup v-model="show" border-radius="24" safe-area-inset-bottom mode="bottom">
<view class="content"> <view class="content">
<view class="billing"> <view class="billing">
<view class="billing-head"> <view class="billing-head">
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<view class="billing-type"> <view class="billing-type">
<checkbox-groups :checked="form.type" :custom-style="customStyle" :options="billingTypeOptions" @handleClick="billingTypeChange"></checkbox-groups> <checkbox-groups :checked="form.type" :custom-style="customStyle" :options="billingTypeOptions" @handleClick="billingTypeChange"></checkbox-groups>
<view class="billing-type-date" @click="openCalendarPopup"> <view class="billing-type-date" @click="openCalendarPopup">
<view class="billing-type-date-text">{{ form.happenTime }}</view> <view class="billing-type-date-text">{{ resetHappenTime(form.happenTime) }}</view>
<u-icon name="arrow-down-fill" class="billing-type-date-icon"></u-icon> <u-icon name="arrow-down-fill" class="billing-type-date-icon"></u-icon>
</view> </view>
</view> </view>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<image :src="takePhotoIcon" mode="" v-else></image> <image :src="takePhotoIcon" mode="" v-else></image>
</view> </view>
<view class="billing-remark-input"> <view class="billing-remark-input">
<u-input <input
type="text" type="text"
v-model="form.remark" v-model="form.remark"
placeholder-style="color: #02A074;" placeholder-style="color: #02A074;"
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
:clearable="false" :clearable="false"
class="form-input" class="form-input"
maxlength="200" maxlength="200"
:cursor-spacing="36"
/> />
</view> </view>
</view> </view>
...@@ -121,16 +122,19 @@ export default { ...@@ -121,16 +122,19 @@ export default {
prop: 'classificationId', prop: 'classificationId',
message: '请选择类型' message: '请选择类型'
} }
] ],
notification : 'update-payments-setting'
}; };
}, },
mounted() { mounted() {
this.init(); this.init();
}, },
onUnload() {
uni.$off(this.notification);
},
methods: { methods: {
init() { init() {
this.form.happenTime = this.parseTime(new Date(), '{y}-{m}-{d}'); this.form.happenTime = this.parseTime(new Date(), '{y}-{m}-{d}');
console.log(this.form.happenTime)
this.getBillTypeOptions(); this.getBillTypeOptions();
this.getQiniuToken(); this.getQiniuToken();
}, },
...@@ -139,8 +143,8 @@ export default { ...@@ -139,8 +143,8 @@ export default {
let { data } = await getBillTypes({ type: this.form.type }); let { data } = await getBillTypes({ type: this.form.type });
let list = []; let list = [];
let resData = this.deepClone(data); let resData = this.deepClone(data);
if (!this.form.classificationId && data[0]) { if (!this.form.classificationId ) {
this.form.classificationId = data[0].id; this.form.classificationId = data[0].id||'';
} }
list = this.chunk(resData, this.limit); list = this.chunk(resData, this.limit);
if (list[list.length - 1].length < this.limit) { if (list[list.length - 1].length < this.limit) {
...@@ -193,6 +197,9 @@ export default { ...@@ -193,6 +197,9 @@ export default {
longitude: '' longitude: ''
}; };
this.form.happenTime = this.parseTime(new Date(), '{y}-{m}-{d}'); this.form.happenTime = this.parseTime(new Date(), '{y}-{m}-{d}');
if(this.billingCategoryList.length){
this.form.classificationId = this.billingCategoryList[0]&&this.billingCategoryList[0][0].id||'';
}
this.show = true; this.show = true;
} }
}, },
...@@ -254,7 +261,12 @@ export default { ...@@ -254,7 +261,12 @@ export default {
this.$emit('afterSave'); this.$emit('afterSave');
}, 1500); }, 1500);
} catch (error) { } catch (error) {
this.showToast(title + '失败'); let {msg}=error
if(msg){
this.showToast(msg);
}else{
this.showToast(title + '失败');
}
} }
this.loading = false; this.loading = false;
}, },
...@@ -276,16 +288,35 @@ export default { ...@@ -276,16 +288,35 @@ export default {
billingTypeChange(e) { billingTypeChange(e) {
console.log(e); console.log(e);
this.form.type = e.value; this.form.type = e.value;
this.form.classificationId = '';
this.getBillTypeOptions(); this.getBillTypeOptions();
}, },
openCalendarPopup() { openCalendarPopup() {
this.$refs['calendar-popup'].open(); this.$refs['calendar-popup'].open();
}, },
resetHappenTime(time){
if(!time){
return ''
}
let d = new Date(time).setHours(0, 0, 0, 0);
let today = new Date().setHours(0, 0, 0, 0);
let obj = {
'-86400000': '昨天',
0: '今天',
86400000: '明天',
};
return obj[d - today] || this.parseTime(time,'{m}-{d}');
},
billingCategoryChange(item) { billingCategoryChange(item) {
if (item.id === 'setting') { if (item.id === 'setting') {
uni.navigateTo({ uni.navigateTo({
url: '/pages/mine/payments-setting/payments-setting' url: '/pages/mine/payments-setting/payments-setting'
}); });
uni.$on(this.notification, res => {
this.getBillTypeOptions();
});
} else { } else {
this.form.classificationId = item.id; this.form.classificationId = item.id;
} }
...@@ -365,7 +396,7 @@ export default { ...@@ -365,7 +396,7 @@ export default {
color: #333333; color: #333333;
&-text { &-text {
text-align: right; text-align: right;
width: 140rpx; width: 90rpx;
height: 48upx; height: 48upx;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -394,6 +425,8 @@ export default { ...@@ -394,6 +425,8 @@ export default {
} }
&-remark { &-remark {
display: flex; display: flex;
width: 100%;
height: 72rpx;
&-upload { &-upload {
display: flex; display: flex;
width: 72upx; width: 72upx;
...@@ -417,10 +450,14 @@ export default { ...@@ -417,10 +450,14 @@ export default {
} }
} }
&-input { &-input {
height: 72rpx;
flex: 1; flex: 1;
padding: 0 24upx; padding: 0 24upx;
display: flex;
align-items: center;
} }
.form-input { .form-input {
width: 100%;
} }
} }
} }
......
This diff is collapsed.
...@@ -133,6 +133,9 @@ export default { ...@@ -133,6 +133,9 @@ export default {
handleClose() { handleClose() {
this.changeVisibleValue(false) this.changeVisibleValue(false)
}, },
stopLoading(){
this.loading = false
}
}, },
} }
</script> </script>
......
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
"style" : "style" :
{ {
"navigationBarTitleText": "快速登录", "navigationBarTitleText": "快速登录",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"navigationStyle": "custom"
} }
} }
...@@ -226,6 +227,15 @@ ...@@ -226,6 +227,15 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}
,{
"path" : "subscribe/subscribe",
"style" :
{
"navigationBarTitleText": "用户订阅",
"enablePullDownRefresh": false
}
} }
] ]
}, },
......
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
</view> </view>
</view> </view>
<view class="debit-detail-right"> <view class="debit-detail-right">
<view class="finish" v-if="detail.status === '1'">账单已结清</view> <view class="debt" v-if="showDebtAmount">
<view class="debt" v-else-if="detail.status === '0'">
<view class="content-item debt-status">欠款</view> <view class="content-item debt-status">欠款</view>
<view class="content-item debt-money"> <view class="content-item debt-money">
<text>¥</text> <text>¥</text>
<text>{{ detail.debtAmount }}</text> <text>{{ detail.debtAmount }}</text>
</view> </view>
</view> </view>
<view class="finish" v-else>账单已结清</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -34,6 +34,15 @@ export default { ...@@ -34,6 +34,15 @@ export default {
default: () => {} default: () => {}
} }
}, },
computed:{
showDebtAmount(){
let debtAmount=this.detail.debtAmount
if(!debtAmount){
return false
}
return parseFloat(debtAmount)>0
}
},
data() { data() {
return {}; return {};
} }
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<view class="container"><debit-detail v-for="item in listData" :key="item.userid" :detail="item" @handleClick="toDetail"></debit-detail></view> <view class="container"><debit-detail v-for="item in listData" :key="item.userid" :detail="item" @handleClick="toDetail"></debit-detail></view>
<view class="loading-view" v-if="!getCurrentPage(index).loaded && !getCurrentPage(index).freshing"><u-loading mode="flower"></u-loading></view> <view class="loading-view" v-if="!getCurrentPage(index).loaded && !getCurrentPage(index).freshing"><u-loading mode="flower"></u-loading></view>
<view v-show="(getCurrentPage(index).pageNumber === 0 && getCurrentPage(index).loaded) || getCurrentPage(index).pageNumber > 1"> <view v-show="(getCurrentPage(index).pageNumber === 0 && getCurrentPage(index).loaded) || getCurrentPage(index).pageNumber > 0">
<u-loadmore :status="getCurrentPage(index).loadStatus" /> <u-loadmore :status="getCurrentPage(index).loadStatus" />
</view> </view>
</template> </template>
...@@ -138,7 +138,6 @@ export default { ...@@ -138,7 +138,6 @@ export default {
size: this.currentPage.size, size: this.currentPage.size,
current: this.currentPage.pageNumber current: this.currentPage.pageNumber
}; };
console.log(postData);
try { try {
let res = await getList(postData); let res = await getList(postData);
let { records, total } = res.data; let { records, total } = res.data;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<view class="top--panel"> <view class="top--panel">
<!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如banner图 --> <!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如banner图 -->
<quoted-price-tips></quoted-price-tips> <quoted-price-tips></quoted-price-tips>
<quoted-price-step></quoted-price-step>
</view> </view>
<!-- 滚动区域 --> <!-- 滚动区域 -->
<view class="scroll-panel" id="scroll-panel" v-loading="loading"> <view class="scroll-panel" id="scroll-panel" v-loading="loading">
...@@ -50,10 +51,12 @@ ...@@ -50,10 +51,12 @@
<script> <script>
import QuotedPriceTips from '../components/quoted-price-tips.vue'; import QuotedPriceTips from '../components/quoted-price-tips.vue';
import QuotedPriceStep from '../components/quoted-price-step.vue';
import { getBrand } from '@/api/bill/quoted-price.js'; import { getBrand } from '@/api/bill/quoted-price.js';
export default { export default {
components: { components: {
QuotedPriceTips QuotedPriceTips,
QuotedPriceStep
}, },
data() { data() {
return { return {
......
<template>
<view class="quoted-price-step">
<view class="quoted-price-step-label">操作流程:</view>
<view class="quoted-price-step-value">
<view class="quoted-price-step-item" v-for="(item, index) in steps" :key="index">
<view class="quoted-price-step-item-num">{{ item.id }}</view>
<view class="quoted-price-step-item-title">{{ item.title }}</view>
<view class="quoted-price-step-item-arrow" v-if="index !== steps.length - 1"><image :src="arrowUrl" mode=""></image></view>
</view>
</view>
</view>
</template>
<script>
import { quotedPriceSteps } from '@/utils/options/bill/index.js';
import { billBaseUrl } from '@/utils/config.js';
export default {
data() {
return {
arrowUrl: billBaseUrl + 'baojiashunxu@3x.png',
steps: quotedPriceSteps
};
}
};
</script>
<style lang="scss" scoped>
.quoted-price-step {
height: 104upx;
background: #ffffff;
border-radius: 16upx;
padding: 0 24upx;
display: flex;
align-items: center;
margin-bottom: 24upx;
font-size: 28upx;
&-label {
color: #8d8d8d;
}
&-value {
display: flex;
align-items: center;
font-weight: bold;
}
&-item {
display: flex;
align-items: center;
&-num {
width: 32upx;
height: 32upx;
display: flex;
align-items: center;
font-size: 24upx;
font-weight: bold;
color: #ffffff;
justify-content: center;
border-radius: 50%;
background-color: $default-color;
margin-right: 8upx;
}
&-arrow {
width: 24upx;
height: 22upx;
display: flex;
margin: 0 20upx;
}
}
}
</style>
<template> <template>
<u-popup v-model="show" border-radius="24" :custom-style="{ 'background-color': '#F6F7FA' }" mode="bottom"> <u-popup v-model="show" border-radius="24" mode="bottom">
<view class="content"> <view class="content">
<view class="charge footer"> <view class="charge footer">
<view class="charge-title">收费列表</view> <view class="charge-title">收费列表</view>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<view class="top--panel"> <view class="top--panel">
<!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如banner图 --> <!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如banner图 -->
<quoted-price-tips></quoted-price-tips> <quoted-price-tips></quoted-price-tips>
<quoted-price-step></quoted-price-step>
</view> </view>
<!-- 滚动区域 --> <!-- 滚动区域 -->
<view class="scroll-panel" id="scroll-panel"> <view class="scroll-panel" id="scroll-panel">
...@@ -83,6 +84,7 @@ ...@@ -83,6 +84,7 @@
</template> </template>
<script> <script>
import QuotedPriceStep from '../components/quoted-price-step.vue';
import UniCollapse from '@/components/uni-collapse/uni-collapse.vue'; import UniCollapse from '@/components/uni-collapse/uni-collapse.vue';
import UniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'; import UniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue';
import QuotedPriceTips from '../components/quoted-price-tips.vue'; import QuotedPriceTips from '../components/quoted-price-tips.vue';
...@@ -92,7 +94,7 @@ import CartPopup from './components/cart-popup.vue'; ...@@ -92,7 +94,7 @@ import CartPopup from './components/cart-popup.vue';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getOffer } from '@/api/bill/quoted-price.js'; import { getOffer } from '@/api/bill/quoted-price.js';
export default { export default {
components: { UniCollapse, UniCollapseItem, QuotedPriceTips, CollapseBody, ShoppingCart, CartPopup }, components: { QuotedPriceStep,UniCollapse, UniCollapseItem, QuotedPriceTips, CollapseBody, ShoppingCart, CartPopup },
data() { data() {
return { return {
form: { form: {
......
...@@ -2,16 +2,7 @@ ...@@ -2,16 +2,7 @@
<!-- 查报价 --> <!-- 查报价 -->
<view class="quoted-price"> <view class="quoted-price">
<quoted-price-tips></quoted-price-tips> <quoted-price-tips></quoted-price-tips>
<view class="quoted-price-step"> <quoted-price-step></quoted-price-step>
<view class="quoted-price-step-label">操作流程:</view>
<view class="quoted-price-step-value">
<view class="quoted-price-step-item" v-for="(item, index) in steps" :key="index">
<view class="quoted-price-step-item-num">{{ item.id }}</view>
<view class="quoted-price-step-item-title">{{ item.title }}</view>
<view class="quoted-price-step-item-arrow" v-if="index !== steps.length - 1"><image :src="arrowUrl" mode=""></image></view>
</view>
</view>
</view>
<view class="quoted-price-brand"> <view class="quoted-price-brand">
<view class="quoted-price-brand-item" v-for="(item, index) in list" :key="index" @click="next(item)"> <view class="quoted-price-brand-item" v-for="(item, index) in list" :key="index" @click="next(item)">
<view class="quoted-price-brand-item-icon"> <view class="quoted-price-brand-item-icon">
...@@ -25,19 +16,18 @@ ...@@ -25,19 +16,18 @@
<script> <script>
import QuotedPriceTips from './components/quoted-price-tips.vue'; import QuotedPriceTips from './components/quoted-price-tips.vue';
import QuotedPriceStep from './components/quoted-price-step.vue';
import { mineBaseUrl, billBaseUrl } from '@/utils/config.js'; import { mineBaseUrl, billBaseUrl } from '@/utils/config.js';
import { quotedPriceSteps, } from '@/utils/options/bill/index.js';
import { serviceTypeOptions, } from '@/utils/options/bill/quoted-price.js'; import { serviceTypeOptions, } from '@/utils/options/bill/quoted-price.js';
export default { export default {
components: { components: {
QuotedPriceTips QuotedPriceTips,
QuotedPriceStep
}, },
data() { data() {
return { return {
billBaseUrl, billBaseUrl,
arrowUrl: billBaseUrl + 'baojiashunxu@3x.png',
steps: quotedPriceSteps,
list: serviceTypeOptions list: serviceTypeOptions
}; };
}, },
...@@ -55,49 +45,7 @@ export default { ...@@ -55,49 +45,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.quoted-price { .quoted-price {
padding: 0 24upx; padding: 0 24upx;
&-step {
height: 104upx;
background: #ffffff;
border-radius: 16upx;
padding: 0 24upx;
display: flex;
align-items: center;
margin-bottom: 24upx;
font-size: 28upx;
&-label {
color: #8d8d8d;
}
&-value {
display: flex;
align-items: center;
font-weight: bold;
}
&-item {
display: flex;
align-items: center;
&-num {
width: 32upx;
height: 32upx;
display: flex;
align-items: center;
font-size: 24upx;
font-weight: bold;
color: #ffffff;
justify-content: center;
border-radius: 50%;
background-color: $default-color;
margin-right: 8upx;
}
&-arrow {
width: 24upx;
height: 22upx;
display: flex;
margin: 0 20upx;
}
}
}
&-brand { &-brand {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</view> </view>
</view> </view>
<u-toast ref="uToast" /> <u-toast ref="uToast" />
<PopExport :visible.sync="visible" @confirm="handleClickConfirm" /> <PopExport ref='pop-export-bill' :visible.sync="visible" @confirm="handleClickConfirm" />
<mid-popup ref="midPopup" @afterSave="afterSave"></mid-popup> <mid-popup ref="midPopup" @afterSave="afterSave"></mid-popup>
<u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar> <u-tabbar :list="tabbar" :mid-button="true" :mid-button-size="80" :before-switch="beforeSwitch"></u-tabbar>
</view> </view>
...@@ -138,8 +138,8 @@ export default { ...@@ -138,8 +138,8 @@ export default {
let startTime = null; let startTime = null;
let endTime = null; let endTime = null;
if (range) { if (range) {
startTime = range[0]; startTime = range[0]+' 00:00:00';
endTime = range[1]; endTime = range[1]+' 23:59:59';
} }
this.downloadExcel({ startTime, endTime }); this.downloadExcel({ startTime, endTime });
// 导出 // 导出
...@@ -164,16 +164,21 @@ export default { ...@@ -164,16 +164,21 @@ export default {
this.saveFile(res); this.saveFile(res);
} catch (e) { } catch (e) {
this.showToast('下载错误'); this.showToast('下载错误');
this.$refs['pop-export-bill'].stopLoading()
console.log('downloadExcel_error', e); console.log('downloadExcel_error', e);
//TODO handle the exception //TODO handle the exception
} }
uni.hideLoading()
}, },
async saveFile(file) { async saveFile(file) {
console.log('saveFile'); console.log('saveFile');
try { try {
let res = await downLoad(file); let res = await downLoad(file);
this.$refs['pop-export-bill'].stopLoading()
this.visible=false
} catch (e) { } catch (e) {
uni.hideLoading(); uni.hideLoading();
this.$refs['pop-export-bill'].stopLoading()
console.log('saveFile_error', e); console.log('saveFile_error', e);
//TODO handle the exception //TODO handle the exception
} }
......
This diff is collapsed.
...@@ -105,6 +105,8 @@ export default { ...@@ -105,6 +105,8 @@ export default {
} }
.status { .status {
width: 100upx; width: 100upx;
height: 40rpx;
line-height: 40rpx;
text-align: right; text-align: right;
margin-left: 38upx; margin-left: 38upx;
color: $default-color; color: $default-color;
......
...@@ -16,11 +16,13 @@ import AbButton from '@/components/common/ab-button.vue'; ...@@ -16,11 +16,13 @@ import AbButton from '@/components/common/ab-button.vue';
import EmptyPage from '@/components/common/empty-page.vue'; import EmptyPage from '@/components/common/empty-page.vue';
import NoData from '@/components/no-data'; import NoData from '@/components/no-data';
import PlanStep from './plan-step.vue'; import PlanStep from './plan-step.vue';
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 } from '@/api/schedule/index.js';
export default { export default {
name: 'plan-view', name: 'plan-view',
mixins: [subscribeMixin],
components: { components: {
AbButton, AbButton,
PlanStep, PlanStep,
...@@ -74,14 +76,18 @@ export default { ...@@ -74,14 +76,18 @@ export default {
url: 'pages/schedule/create-schedule/create-schedule' url: 'pages/schedule/create-schedule/create-schedule'
}); });
}, },
handleRemind(item) { // 拉起订阅
async handleRemind(item) {
if (item.status !== '1') { if (item.status !== '1') {
return false; return false;
} }
uni.showToast({ try{
icon: 'none', await this.getSubscribeMessage(this.scene.trip); // 拉起订阅
title: '提醒' this.showToast('订阅成功');
}); }catch(e){
//TODO handle the exception
}
}, },
handleClick(item) { handleClick(item) {
uni.navigateTo({ uni.navigateTo({
......
...@@ -59,6 +59,7 @@ export default { ...@@ -59,6 +59,7 @@ export default {
onShow() { onShow() {
if (!this.firstEnter) { if (!this.firstEnter) {
this.getList(); this.getList();
this.getSignList()
} }
}, },
methods: { methods: {
...@@ -108,7 +109,7 @@ export default { ...@@ -108,7 +109,7 @@ export default {
}; };
}); });
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs["lunc-calendar"].init(this.date) this.$refs["lunc-calendar"].initSign()
}) })
} }
} catch (e) { } catch (e) {
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<view class="quick-color-cancel" :style="{ 'padding-top': platform == '3' ? 0 : statusBarHeight + 'px' }"><u-icon name="close" @click="toIndex"></u-icon></view> <view class="quick-color-cancel" :style="{ 'padding-top': platform == '3' ? 0 : statusBarHeight + 'px' }"><u-icon name="close" @click="toIndex"></u-icon></view>
</view> </view>
<view class="quick-background"> <view class="quick-background">
<image src="/static/images/login/startup/denglulogo@3x.png" mode="" class="quick-background-logo"></image> <image src="/static/image/login/startup/denglulogo@3x.png" mode="" class="quick-background-logo"></image>
<image src="/static/images/login/startup/shiyongbanshou@3x.png" mode="" class="quick-background-slogn"></image> <image src="/static/image/index/shiyongbanshou@3x.png" mode="" class="quick-background-slogn"></image>
</view> </view>
<view class="quick-mark"> <view class="quick-mark">
<view class="quick-center" v-if="isIOS && platform === '4'"> <view class="quick-center" v-if="isIOS && platform === '4'">
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<view class="quick-center" v-else> <view class="quick-center" v-else>
<view class="submit-button-box"> <view class="submit-button-box">
<view class="submit-button" @click.stop="submit" :loading="loading"> <view class="submit-button" @click.stop="submit" :loading="loading">
<image src="/static/images/login/startup/weixin@3x.png" mode="" class="submit-button-icon" v-if="!(platform == '2' || platform == '3')"></image> <image src="/static/image/index/weixin@3x.png" mode="" class="submit-button-icon" v-if="!(platform == '2' || platform == '3')"></image>
<text>{{ platform == '2' || platform == '3' ? '授权登录' : '微信登录' }}</text> <text>{{ platform == '2' || platform == '3' ? '授权登录' : '微信登录' }}</text>
</view> </view>
</view> </view>
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
&-color { &-color {
width: 100%; width: 100%;
height: 30%; height: 30%;
background: linear-gradient(180deg, #e9f3ff 0%, #ffffff 100%); background: linear-gradient(180deg, #F4FFFC 0%, #ffffff 100%);
overflow: hidden; overflow: hidden;
&-cancel { &-cancel {
width: 60upx; width: 60upx;
......
This diff is collapsed.
<template> <template>
<view class="login-index"> <view class="quick">
<view class="main"> <view class="quick-color">
<view class="m-top flex flex-column flex-yc"> <view class="quick-color-cancel" :style="{ 'padding-top': platform == '3' ? 0 : statusBarHeight + 'px' }"><u-icon name="close" @click="toIndex"></u-icon></view>
<view class="t-logo"> </view>
<image class="t-logo" src="/static/images/logo_quick_search.png" /> <view class="quick-background">
</view> <image src="/static/images/login/startup/denglulogo@3x.png" mode="" class="quick-background-logo"></image>
<text class="t-title">扳手快查</text> <image src="/static/images/login/startup/shiyongbanshou@3x.png" mode="" class="quick-background-slogn"></image>
</view> </view>
<view class="m-mid"> <view class="quick-mark">
<block v-if="needAuth"> <view class="quick-center">
<view class="auth-tip">我们需要取得您的手机号,以关联您的扳手快查账号</view> <view class="auth-tip">我们需要取得您的手机号,以关联您的扳手快查账号</view>
<view class="flex flex-between"> <view class="quick-center-buttons">
<button class="login-refuse" @tap="refuseAuth">拒绝</button> <button class="login-refuse" @tap="refuseAuth">拒绝</button>
<button class="login-accept" open-type="getPhoneNumber" lang="zh_CN" @getphonenumber="signup">立即登录</button> <button class="login-refuse login-accept" open-type="getPhoneNumber" lang="zh_CN" @getphonenumber="signup">立即登录</button>
</view>
</block>
<block v-else>
<view class="auth-tip">授权成功,立即登录</view>
<button class="login-now" open-type="getPhoneNumber" @getphonenumber="signup">立即登录</button>
</block>
</view>
<view class="m-btm">
<view class="b-list">
<view class="b-item flex flex-yc" v-for="(item, index) in list" :key="index">
<view class="i-img">
<image class="i-img" :src="item.img" />
</view>
<view class="i-right flex flex-column flex-between">
<text class="r-top">{{ item.title }}</text>
<text class="r-btm">{{ item.intro }}</text>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import log from '@/utils/log.js' import log from '@/utils/log.js';
import {showToast} from "@/utils/common.js" import { showToast } from '@/utils/common.js';
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
export default { export default {
components: {}, components: {},
...@@ -70,7 +51,8 @@ export default { ...@@ -70,7 +51,8 @@ export default {
], ],
canIUseGetUserProfile: false, canIUseGetUserProfile: false,
agree: false, agree: false,
params: {} params: {},
statusBarHeight: 20
}; };
}, },
computed: { computed: {
...@@ -88,8 +70,15 @@ export default { ...@@ -88,8 +70,15 @@ export default {
this.canIUseGetUserProfile = true; this.canIUseGetUserProfile = true;
break; break;
} }
let { statusBarHeight } = this.systemInfo;
this.statusBarHeight = statusBarHeight;
}, },
methods: { methods: {
toIndex(){
uni.navigateBack({
delta:1
})
},
// setLoginStatus() { // setLoginStatus() {
// // 授权用户信息不为空,说明已经授权过无需重新授权 // // 授权用户信息不为空,说明已经授权过无需重新授权
// if (app.globalData.tmp && app.globalData.tmp.wxUserInfo) { // if (app.globalData.tmp && app.globalData.tmp.wxUserInfo) {
...@@ -125,7 +114,7 @@ export default { ...@@ -125,7 +114,7 @@ export default {
if (this.needAuth) { if (this.needAuth) {
uni.getUserProfile({ uni.getUserProfile({
desc: '用于授权登录', desc: '用于授权登录',
success: res=> { success: res => {
console.log('授权成功', res); console.log('授权成功', res);
const userInfo = res.userInfo || { const userInfo = res.userInfo || {
nickName: '', nickName: '',
...@@ -264,32 +253,38 @@ export default { ...@@ -264,32 +253,38 @@ export default {
} else { } else {
console.log('用户同意', e.detail); console.log('用户同意', e.detail);
const detail = e.detail || {}; const detail = e.detail || {};
let params={ let params = {
encryptedData: detail.encryptedData, encryptedData: detail.encryptedData,
iv: detail.iv, iv: detail.iv
// code: detail.code, // code: detail.code,
} };
this.$store.dispatch('Auto_login',params).then((res)=>{ this.$store
console.log("登录成功",res) .dispatch('Auto_login', params)
this.$store.dispatch('Get_UserInfo').then(()=>{ .then(res => {
showToast('登录成功'); console.log('登录成功', res);
setTimeout(()=>{ this.$store
uni.switchTab({ .dispatch('Get_UserInfo')
url:"/pages/index/index" .then(() => {
showToast('登录成功');
setTimeout(() => {
uni.switchTab({
url: '/pages/index/index'
});
}, 1000);
}) })
},1000) .catch(() => {
}).catch(()=>{ showToast('获取用户信息失败');
showToast('获取用户信息失败'); });
}) })
}).catch((err)=>{ .catch(err => {
showToast('登录失败'); showToast('登录失败');
console.log("登录失败",err) console.log('登录失败', err);
}) });
// let userInfo = (app.globalData.tmp && app.globalData.tmp.wxUserInfo) || { // let userInfo = (app.globalData.tmp && app.globalData.tmp.wxUserInfo) || {
// nickName: '', // nickName: '',
// avatarUrl: '' // avatarUrl: ''
// }; // };
return false return false;
login login
.wxLogin() .wxLogin()
.then(res => { .then(res => {
...@@ -305,7 +300,7 @@ export default { ...@@ -305,7 +300,7 @@ export default {
}) })
.then(res => { .then(res => {
console.log('绑定手机之后接口登录结果:', res, 'token:', api.getToken()); console.log('绑定手机之后接口登录结果:', res, 'token:', api.getToken());
if (res) { if (res) {
if ((res.status && res.data) || api.getToken()) { if ((res.status && res.data) || api.getToken()) {
self.goBackPage(); self.goBackPage();
...@@ -419,113 +414,123 @@ export default { ...@@ -419,113 +414,123 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.login-index .main { .quick {
font-size: 24rpx; width: 100%;
} height: 100vh;
.login-index .main .m-top {
margin-top: 30rpx;
}
.login-index .main .m-top .t-logo {
margin-bottom: 15rpx;
width: 138rpx;
height: 138rpx;
background: #ffffff; background: #ffffff;
border-radius: 50%; position: relative;
}
.login-index .main .m-top .t-title {
font-size: 40rpx;
font-weight: bold;
color: #333333;
line-height: 1;
}
.login-index .main .m-mid {
padding: 0 40rpx;
margin-bottom: 24rpx;
}
.login-index .main .m-mid .auth-tip {
margin-top: 80rpx;
margin-bottom: 40rpx;
text-align: center;
font-size: 24rpx;
color: #8d8d8d;
line-height: 1;
}
.login-index .main .m-mid button {
padding: 0;
margin: 0;
}
.login-index .main .m-mid button.login-now {
/* margin-top: 138rpx; */
width: 670rpx;
height: 98rpx;
background: #07c160;
border-radius: 49rpx;
color: #ffffff;
font-weight: bold;
box-shadow: 6rpx 6rpx 40rpx rgba(7, 193, 96, 0.5);
}
.login-index .main .m-mid button.login-refuse,
.login-index .main .m-mid .login-accept {
width: 318rpx;
height: 86rpx;
line-height: 86rpx;
border-radius: 49rpx;
color: #ffffff;
font-weight: bold;
}
.login-index .main .m-mid button.login-refuse {
color: #333333;
background: #ededed;
}
.login-index .main .m-mid button.login-accept {
background: #07c160;
box-shadow: 6rpx 6rpx 40rpx rgba(7, 193, 96, 0.5);
}
.login-index .main .m-btm .b-list {
padding: 80rpx 40rpx 0 40rpx;
}
.login-index .main .m-btm .b-list .b-item {
margin-bottom: 55rpx;
}
.login-index .main .m-btm .b-list .b-item .i-img {
margin-right: 36rpx;
width: 60rpx;
height: 60rpx;
flex-shrink: 0;
}
.login-index .main .m-btm .b-list .b-item .i-right .r-top {
margin-bottom: 21rpx;
font-size: 28rpx;
color: #333333; color: #333333;
} &-color {
.login-index .main .m-btm .b-list .b-item .i-right .r-btm { width: 100%;
font-size: 24rpx; height: 30%;
color: #888888; background: linear-gradient(180deg, #F4FFFC 0%, #ffffff 100%);
} overflow: hidden;
.agree-view { &-cancel {
font-size: 28rpx; width: 60upx;
color: #8d8d8d; height: 60upx;
display: flex; text-align: left;
justify-content: center; margin-top: 20upx;
align-items: center; margin-left: 32upx;
} font-size: 32upx;
}
}
&-background {
position: absolute;
overflow: hidden;
top: 20%;
text-align: center;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
&-logo {
width: 144upx;
height: 144upx;
}
&-slogn {
width: 362upx;
height: 38upx;
margin-top: 46upx;
}
}
&-mark {
// overflow: hidden;
width: 100%;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
&-center {
position: relative;
width: 100%;
.submit-button-box {
width: 100%;
padding: 0 80upx;
margin-bottom: 54upx;
.submit-button {
position: relative;
width: 100%;
height: 104upx;
border-radius: 52upx;
line-height: 104upx;
color: #ffffff;
font-size: 32upx;
font-weight: bold;
text-align: center;
background: #00c802;
box-shadow: 0px 12upx 24upx 0px rgba(0, 200, 2, 0.32);
font-weight: 500;
display: flex;
align-items: center;
justify-content: center;
&:active {
background: #41c845;
}
.submit-button-icon {
width: 38upx;
height: 32upx;
margin-right: 16upx;
}
}
}
.auth-tip {
margin-top: 80rpx;
margin-bottom: 40rpx;
text-align: center;
font-size: 24rpx;
color: #8d8d8d;
line-height: 1;
}
&-buttons {
display: flex;
align-items: center;
justify-content: space-between;
}
.login-refuse {
width: 292rpx;
height: 104rpx;
border-radius: 16rpx;
border: 2rpx solid #cccccc;
line-height: 104rpx;
font-size: 32rpx;
color: #8d8d8d;
font-weight: bold;
background: #ffffff;
}
.login-accept {
color: #ffffff;
background: $default-color;
box-shadow: 0px 12rpx 24rpx 0px rgba(2, 160, 116, 0.2);
border: none;
}
.check-circle-view { .cancel-button {
border-radius: 50%; text-align: center;
border: 2rpx solid #3383fe; font-size: 32upx;
width: 36rpx; color: #8d8d8d;
height: 36rpx; }
} }
.icon-view {
width: 56rpx;
height: 56rpx;
display: flex;
justify-content: center;
align-items: center;
}
.agree-text-view {
}
.name-text {
color: #3383fe;
} }
</style> </style>
...@@ -293,8 +293,8 @@ export default { ...@@ -293,8 +293,8 @@ export default {
} }
if (range) { if (range) {
param = { param = {
end: range[0] + ' 00:00:00', end: range[1] + ' 23:59:59',
start: range[1] + ' 00:00:00', start: range[0] + ' 00:00:00',
} }
} }
// 导出 // 导出
......
...@@ -57,7 +57,8 @@ export default { ...@@ -57,7 +57,8 @@ export default {
}, },
listHeight: 0, listHeight: 0,
showTip: false, showTip: false,
imageTop: 0 imageTop: 0,
notification : 'update-payments-setting'
}; };
}, },
computed: { computed: {
...@@ -82,7 +83,15 @@ export default { ...@@ -82,7 +83,15 @@ export default {
onReady() { onReady() {
// this.showTipView(); // this.showTipView();
}, },
onUnload() {
uni.$off(this.notification);
},
methods: { methods: {
updateEmit(){
uni.$emit(this.notification, {
content: ""
});
},
closeDrap() { closeDrap() {
this.$refs['drap-view'].closeAll(); this.$refs['drap-view'].closeAll();
}, },
...@@ -140,7 +149,6 @@ export default { ...@@ -140,7 +149,6 @@ export default {
item.label = item.name; item.label = item.name;
item.icon=item.recordSelectedIcon, item.icon=item.recordSelectedIcon,
item.show=false item.show=false
console.log(item.icon)
}); });
this.list = data || []; this.list = data || [];
} catch (e) { } catch (e) {
...@@ -164,6 +172,7 @@ export default { ...@@ -164,6 +172,7 @@ export default {
} }
let res = await sortList(params); let res = await sortList(params);
await this.getList(); await this.getList();
await this.updateEmit()
} catch (e) { } catch (e) {
this.getList(); this.getList();
//TODO handle the exception //TODO handle the exception
...@@ -176,6 +185,7 @@ export default { ...@@ -176,6 +185,7 @@ export default {
} }
let res = await deleteById(params) let res = await deleteById(params)
await this.getList(); await this.getList();
await this.updateEmit()
} catch (e) { } catch (e) {
this.getList(); this.getList();
//TODO handle the exception //TODO handle the exception
...@@ -198,14 +208,12 @@ export default { ...@@ -198,14 +208,12 @@ export default {
} }
let res = await update(params) let res = await update(params)
await this.getList(); await this.getList();
await this.updateEmit()
} catch (e) { } catch (e) {
this.getList(); this.getList();
//TODO handle the exception //TODO handle the exception
} }
}, },
naviTo() {
this.$u.route('pages/camp/layout');
}
} }
}; };
</script> </script>
......
<template>
<view class="subscribe-card">
<view class="subscribe-card-head" :class="{ 'head-border': headBorder }">
<view class="subscribe-card-head-label ellipsis">
<view class="subscribe-card-head-label-icon" v-if="leftIcon"><image :src="leftIcon" mode=""></image></view>
<view class="subscribe-card-head-label-text ellipsis">{{ title }}</view>
</view>
<view class="subscribe-card-head-right" hover-class="u-hover-class" @click="handleClick" v-if="rightButton">{{ rightButtonText }}</view>
</view>
<view class="subscribe-card-content"><slot></slot></view>
</view>
</template>
<script>
export default {
name: 'subscribe-card',
props: {
title: {
type: String | null,
default: '标题'
},
rightButtonText: {
type: String | null,
default: '全部+1'
},
rightButton: {
type: Boolean,
default: true
},
headBorder: {
type: Boolean,
default: true
},
leftIcon: {
type: String | null,
default: null
}
},
data() {
return {};
},
methods: {
handleClick() {
this.$emit('handleClickRight');
}
}
};
</script>
<style lang="scss" scoped>
image {
width: 100%;
height: 100%;
}
.subscribe-card {
width: 100%;
background: #ffffff;
border-radius: 8rpx;
padding: 0 24rpx;
overflow: hidden;
margin-bottom: 24rpx;
.ellipsis {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
&-head {
display: flex;
width: 100%;
height: 96rpx;
justify-content: space-between;
align-items: center;
&-label {
width: 70%;
font-size: 32rpx;
font-weight: bold;
display: flex;
align-items: center;
&-icon {
width: 28rpx;
height: 32rpx;
margin-right: 12rpx;
}
&-text {
flex: 1;
}
}
&-right {
background: #28C445;
border-radius: 8rpx;
font-size: 24rpx;
color: #FFFFFF;
width: 120rpx;
height: 48rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
}
}
.head-border {
border-bottom: 2rpx solid #f6f7fa;
}
}
</style>
<template>
<view class="subscribe-item">
<view class="subscribe-item-left" :class="{ 'has-time-button': timeButton }">
<view class="subscribe-item-left-label ellipsis">
<text>{{ detail.name }}</text>
<text class="subscribe-item-left-label-num" :class="{ 'red-num': countColor }">
<text>{{ detail.number }}</text>
<text>次</text>
</text>
</view>
<view class="subscribe-item-left-desc ellipsis" v-if="detail.desc">{{ detail.desc }}</view>
</view>
<view class="subscribe-item-right">
<view class="subscribe-item-right-button" hover-class="u-hover-class" :class="{ 'subscribe-item-right-button-active': timeButton }" v-if="timeButton" @click="timeSetting">
{{ timeButtonText }}
</view>
<view class="subscribe-item-right-button" hover-class="u-hover-class" @click="handleClick">{{ rightButtonText }}</view>
</view>
</view>
</template>
<script>
export default {
name: 'subscribe-item',
props: {
detail: {
type: Object,
default: () => {}
},
rightButtonText: {
type: String | null,
default: '订阅+1'
},
rightButton: {
type: Boolean,
default: false
}
},
data() {
return {};
},
computed: {
countColor() {
return this.detail.number <= 1 ? true : false;
},
timeButton() {
let { type } = this.detail;
if (type) {
return type.code === 'TIMING' ? true : false;
}
return false;
},
timeButtonText() {
return this.detail.config && this.detail.config.day && this.detail.config.day.length ? '已设置' : '设置时间';
}
},
methods: {
handleClick() {
this.$emit('handleClickRight', this.detail);
},
timeSetting() {
if (!this.detail.id) {
uni.showToast({
icon: 'none',
title: '订阅id不能为空'
});
return false;
}
this.$u.route({
url: 'pages/message/subscribe/subscription-setting/subscription-setting',
params: {
detail: JSON.stringify(this.detail)
}
});
}
}
};
</script>
<style lang="scss" scoped>
.subscribe-item {
width: 100%;
height: 156rpx;
padding: 24rpx 0;
display: flex;
justify-content: space-between;
align-items: center;
color: #333333;
.ellipsis {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
}
&-left {
width: 70%;
font-size: 28rpx;
&-label {
font-weight: bold;
&-num {
font-size: 24rpx;
line-height: 24rpx;
font-weight: 500;
color: #3878ff;
margin-left: 16rpx;
}
.red-num {
color: #fc524d;
}
}
&-desc {
margin-top: 24rpx;
font-size: 26rpx;
color: #8d8d8d;
}
}
.has-time-button {
width: 60%;
}
&-right {
display: flex;
align-items: center;
&-button {
width: 120rpx;
height: 48rpx;
box-sizing: border-box;
// padding: 12rpx 14rpx;
display: flex;
align-items: center;
justify-content: center;
// text-align: center;
background: #28C445;
border-radius: 8rpx;
font-size: 24rpx;
// line-height: 48rpx;
color: #FFFFFF;
margin-right: 24rpx;
&:last-child {
margin-right: 0;
}
}
&-button-active {
background: #ffffff;
border: 2rpx solid #28C445;
color: #28C445;
}
}
}
</style>
<template>
<view class="subscribe-message">
<view class="subscribe-message-content">
<view class="subscribe-message-content-item" v-for="item in messageList" :key="item">{{ item }}</view>
</view>
<view class="official-account">
<view class="official-account-component" v-if="show"><official-account style=""></official-account></view>
<view class="official-account-view" @click="toUrl">
<view class="official-account-view-label ellipsis">{{ title }}</view>
<view class="official-account-view-right">{{ rightButtonText }}</view>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'subscribe-message',
props: {
isSubscribe: {
type: Boolean | null,
default: false
},
show: {
type: Boolean,
default: false
},
},
computed: {
rightButtonText() {
return this.isSubscribe ? '已关注' : '点击关注';
}
},
data() {
return {
messageList: [
'1. 根据微信小程序官方规定,推送消息需用户主动授权',
'2. 成功授权一次,累加一次推送机会',
'3. 成功推送一次,消耗一次推送机会',
'所以大家根据需要进行授权添加推送次数。'
],
title: '消息不错过,请关注微信公众号 “咖营”'
};
},
methods:{
toUrl(){
if(this.show){
return false
}
this.$u.route({
url:"pages/message/official-account-page/official-account-page"
})
}
}
};
</script>
<style lang="scss" scoped>
.subscribe-message {
&-content {
margin: 20rpx 0;
&-item {
line-height: 48rpx;
font-size: 26rpx;
}
}
.official-account {
width: 100%;
height: 112rpx;
position: relative;
overflow: hidden;
&-component {
position: absolute;
z-index: 10;
top: -20px;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
&-view {
// background-color: #ffffff;
position: absolute;
z-index: 1;
top: 0;
left: 0;
display: flex;
width: 100%;
height: 100%;
justify-content: space-between;
align-items: center;
border-top: 2rpx solid #f6f7fa;
&-label {
width: 80%;
font-size: 28rpx;
}
&-right {
padding: 12rpx 14rpx;
color: #3878ff;
border: 2rpx solid #3878ff;
border-radius: 8rpx;
font-size: 24rpx;
line-height: 24rpx;
}
}
}
}
</style>
<template>
<view class="subscribe footer">
<!-- <NavbarNormal :background="{ background: '#f6f7fa' }" title="用户订阅" titleColor="#191C27" title-bold :border-bottom="false"></NavbarNormal> -->
<!-- <CampTabs
height="70"
activeColor="#333333"
inactive-color="#999999"
bar-height="10"
bar-width="22"
bar-image="tishiguangbiao@3x.png"
:list="listGroup"
:current="current"
@change="change"
font-size="32"
bold
bg-color="transparent"
></CampTabs> -->
<view class="subscribe-content">
<subscribe-card title="常用订阅,建议增加订阅次数" :leftIcon="commonLeftIcon" rightButtonText="全部+1" rightButton @handleClickRight="clickCommon">
<subscribe-item
v-for="(item, index) in subscribeCommon"
:key="item.id"
:detail="item"
rightButtonText="推送+1"
rightButton
@handleClickRight="clickSubscribe"
></subscribe-item>
</subscribe-card>
</view>
</view>
</template>
<script>
// import CampTabs from '@/components/camp-tabs';
import SubscribeCard from './components/subscribe-card.vue';
import SubscribeItem from './components/subscribe-item.vue';
import SubscribeMessage from './components/subscribe-message.vue';
import { mineBaseUrl } from '@/utils/config.js';
// import { getColdScene } from '@/utils/common.js';
import { getList } from '@/api/mine/subscribe.js';
import { mapGetters } from 'vuex';
export default {
components: {
// CampTabs,
SubscribeCard,
SubscribeItem,
SubscribeMessage
},
data() {
return {
// coldSceneList,
current: 0,
listGroup: [{ name: '用户订阅', type: 'USER' }, { name: '营主订阅', type: 'OWNER' }],
swiperHeight: 300,
// 常用订阅
subscribeCommon: [],
// 低频订阅
subscribeOther: [],
// 营主订阅
subscribeCampOwner: [],
isSubscribe: false, // 是否关注了公众号
commonLeftIcon: mineBaseUrl + 'dingyue2@3x.png',
showOfficialAccount: false
};
},
computed: {
...mapGetters(['loginChannel'])
},
onLoad() {
// this.checkScene()
},
onShow() {
// 查询是否关注了公众号
// this.queryOfficialAccount();
// 查询订阅列表
this.getSubscribeList();
// 子页面保存,传递参数
// uni.$on('onSubscriptionSetting', data => {
// console.log('监听到事件来自 updateData ,携带参数为:', data);
// });
},
methods: {
// 查询是否关注了公众号
async queryOfficialAccount() {
// let res=await this.$u.api.
// this.isSubscribe = !this.isSubscribe;
},
// 判断场景值是否能显示公众号
checkScene() {
let scene = getColdScene();
let index = this.coldSceneList.findIndex(e => e === scene);
console.log(index);
this.showOfficialAccount = index === -1 ? false : true;
},
// 查询订阅列表
async getSubscribeList() {
try {
let params = {
channel: this.loginChannel,
scene:''
};
let { data } = await getList(params);
this.subscribeCommon = data;
} catch (e) {
this.showToast('获取订阅模板失败');
//TODO handle the exception
}
},
change(index) {
this.current = index;
this.getSubscribeList();
},
// 点击单个订阅
clickSubscribe(item) {
if (!item.outTempleId) {
uni.showToast({
title: '消息模板id不能为空'
});
return false;
}
this.requestSubscribeMessage([item]);
},
// 点击全部订阅
clickCommon() {
this.subscribeAll(this.subscribeCommon);
},
clickOther() {
this.subscribeAll(this.subscribeOther);
},
clickCampOwner() {
this.subscribeAll(this.subscribeCampOwner);
},
subscribeAll(list) {
if (!list || list.length <= 0) {
return false;
}
let tmplIds = [...list];
tmplIds.sort((a, b) => a.number - b.number);
tmplIds = tmplIds.slice(0, 3);
this.requestSubscribeMessage(tmplIds);
},
requestSubscribeMessage(tempList = []) {
let tmplIds = tempList.map(item => item.outTempleId);
uni.requestSubscribeMessage({
tmplIds: tmplIds,
success: res => {
console.log(res);
this.saveSubscribeCount(tempList, res);
},
fail(err) {
console.log(err);
uni.showToast({
icon: 'none',
title: '订阅失败'
});
}
});
},
saveSubscribeCount(tmplIds, res) {
let countList = [];
let rejectList = [];
if (tmplIds && res && tmplIds.length) {
tmplIds.forEach(item => {
if (res[item.outTempleId] && res[item.outTempleId] === 'accept') {
countList.push(item);
} else {
rejectList.push(item);
}
});
}
console.log(`发起 ${tmplIds.length} 项订阅 , 用户同意订阅 ${countList.length} 项 , 拒绝 ${rejectList.length} 项`);
if (countList.length) {
this.addCount(countList);
}
},
async addCount(tempList) {
let params = tempList.map(item => item.id);
let res = await this.$u.api.addSubscribeCountByMessageModules(this.camp_id, params);
if (res) {
this.getSubscribeList();
}
}
}
};
</script>
<style lang="scss" scoped>
.subscribe {
background: #f6f7fa;
height: 100vh;
padding: 0 24rpx;
display: flex;
flex-direction: column;
&-content {
flex: 1;
width: 100%;
padding: 24rpx 0;
overflow: hidden;
.scorll-view {
width: 100%;
height: 100%;
overflow: hidden;
}
}
}
.footer {
padding-bottom: constant(safe-area-inset-bottom);
/* 兼容 iOS < 11.2 */
padding-bottom: env(safe-area-inset-bottom);
/* 兼容 iOS >= 11.2 */
}
</style>
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
remindMinute: '', remindMinute: '',
name: '', // 标题 name: '', // 标题
content: '', content: '',
attach: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3' attach: ''
}, },
errorType: ['toast', 'border-bottom'], errorType: ['toast', 'border-bottom'],
rules: { rules: {
......
...@@ -23,9 +23,9 @@ ...@@ -23,9 +23,9 @@
<text>{{ detail.type.desc }}</text> <text>{{ detail.type.desc }}</text>
</text> </text>
<text v-else-if="item.value === 'remindMinute'"> <text v-else-if="item.value === 'remindMinute'">
<text>{{ myFilter(detail[item.value] + '', scheduleSettingOptions) }}</text> <text>{{ detail[item.value]?myFilter(detail[item.value] + '', scheduleSettingOptions):'' }}</text>
</text> </text>
<text v-else>{{ detail[item.value] }}</text> <text v-else>{{ detail[item.value]||'' }}</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -66,7 +66,8 @@ let { calendar } = require('./calendar.js'); ...@@ -66,7 +66,8 @@ let { calendar } = require('./calendar.js');
* @event {Function()} dayChange 点击日期触发事件 * @event {Function()} dayChange 点击日期触发事件
* @event {Function()} monthChange 切换月份触发事件 * @event {Function()} monthChange 切换月份触发事件
*/ */
import { parseTime } from '@/utils/common.js'; import { parseTime, getTime } from '@/utils/common.js';
export default { export default {
name: 'LuncCalendar', name: 'LuncCalendar',
props: { props: {
...@@ -150,6 +151,24 @@ export default { ...@@ -150,6 +151,24 @@ export default {
this.initDateTime(dates); this.initDateTime(dates);
this.selectDate = JSON.parse(JSON.stringify(dates)); this.selectDate = JSON.parse(JSON.stringify(dates));
}, },
initSign() {
this.allDataArr.map(item => {
item.map(el => {
let { sYear, sMonth, day } = el;
this.signList.map(item => {
let sY = new Date(item.date).getFullYear();
let sM = new Date(item.date).getMonth() + 1;
let sD = new Date(item.date).getDate();
if (sY == sYear && sM == sMonth && sD == day) {
this.$set(el, 'daySign', item);
let today = getTime(parseTime(new Date(),'{y}-{m}-{d}'));
let target = getTime(item.date);
this.$set(el, 'pastTime', target < today ? true : false);
}
});
});
});
},
chooseMonth(e) { chooseMonth(e) {
let { value } = e.detail; let { value } = e.detail;
let nd = value + '-' + this.selDate.day; let nd = value + '-' + this.selDate.day;
...@@ -162,9 +181,9 @@ export default { ...@@ -162,9 +181,9 @@ export default {
month: nd.getMonth() + 1, month: nd.getMonth() + 1,
day: nd.getDate() day: nd.getDate()
}; };
this.$emit('chooseMonth',{ this.$emit('chooseMonth', {
date:year + '-' + month + '-' + day date: year + '-' + month + '-' + day
}) });
this.initDateTime(date); this.initDateTime(date);
}, },
setPickValue() { setPickValue() {
...@@ -246,9 +265,9 @@ export default { ...@@ -246,9 +265,9 @@ export default {
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 == year && sM == month && sD == day){ if (sY == year && sM == month && sD == day) {
daySign = item daySign = item;
}; }
}); });
let dayInfo = { day, sYear: year, sMonth: month, week, lunar, dayLunar, isFestival, isToday, dayType, daySign }; let dayInfo = { day, sYear: year, sMonth: month, week, lunar, dayLunar, isFestival, isToday, dayType, daySign };
let dayClass = this.getDayClass(dayInfo); let dayClass = this.getDayClass(dayInfo);
......
...@@ -27,7 +27,9 @@ export const whiteList = ['/pages/index/index', '/pages/index/schedule/schedule' ...@@ -27,7 +27,9 @@ export const whiteList = ['/pages/index/index', '/pages/index/schedule/schedule'
]; // 路由白名单 ]; // 路由白名单
export const responseWhiteList = ['/rest/bookRecord/export', '/rest/exchangeCode/check','/rest/exchangeCode/exchange']; // 请求URL白名单,此名单内的请求不作状态码判断,在resolve中直接返回 export const responseWhiteList = ['/rest/bookRecord/export', '/rest/exchangeCode/check','/rest/exchangeCode/exchange']; // 请求URL白名单,此名单内的请求不作状态码判断,在resolve中直接返回
export const sceneOptions = {
trip: "TRIP",
}
export const loginInfo = { export const loginInfo = {
"account": "", "account": "",
"authType": "", "authType": "",
......
import { import {
billBaseUrl billBaseUrl
} from "@/utils/config.js" } from "@/utils/config.js"
export const billingTypeOptions = [{ export const billingTypeOptions = [
{
value: "INCOME", value: "INCOME",
label: "收入" label: "收入"
}, },
...@@ -95,11 +96,11 @@ export const debitNotePages = [{ ...@@ -95,11 +96,11 @@ export const debitNotePages = [{
export const debitNoteTabs = [{ export const debitNoteTabs = [{
title: '欠款', title: '欠款',
name: '' name: true
}, },
{ {
title: '正常', title: '正常',
name: '' name: false
}, },
{ {
title: '全部', title: '全部',
......
...@@ -9,7 +9,7 @@ export const minPopupOptions = [{ ...@@ -9,7 +9,7 @@ export const minPopupOptions = [{
}, },
{ {
label: '维修帐', label: '维修帐',
path: '', path: '/pages/maintain-bill/create',
icon: indexBaseUrl + 'weixiuzhang@3x.png', icon: indexBaseUrl + 'weixiuzhang@3x.png',
type: '2', type: '2',
}, },
......
const baseUrl= process.uniEnv.qn_base_url+'mine/' const baseUrl = process.uniEnv.qn_base_url + 'mine/'
// 常用功能 // 常用功能
export const usedOptions = [{ export const usedOptions = [{
id: 1, id: 1,
title: '店铺设置', title: '店铺设置',
icon: baseUrl+'/dianpushezhi@3x.png', icon: baseUrl + '/dianpushezhi@3x.png',
path: "/pages/mine/shop-setting/shop-setting" path: "/pages/mine/shop-setting/shop-setting"
}, },
{ {
id: 2, id: 2,
title: '收支设置', title: '收支设置',
icon: baseUrl+'/shouzhishezhi@3x.png', icon: baseUrl + '/shouzhishezhi@3x.png',
path: "/pages/mine/payments-setting/payments-setting" path: "/pages/mine/payments-setting/payments-setting"
}, },
{ {
id: 3, id: 3,
title: '兑换会员', title: '兑换会员',
icon: baseUrl+'/duihuanhuiyuan@3x.png', icon: baseUrl + '/duihuanhuiyuan@3x.png',
path: "/pages/mine/cd-key/cd-key" path: "/pages/mine/cd-key/cd-key"
}, },
{ {
id: 4, id: 4,
title: '联系客服', title: '联系客服',
icon: baseUrl+'/lianxikefu1@3x.png', icon: baseUrl + '/lianxikefu1@3x.png',
path: "/pages/mine/service/service" path: "/pages/mine/service/service"
}, },
] ]
export const packageOptions = [{ export const packageOptions = [
// {
// id: 0,
// title: '用户订阅',
// icon: 'file-text',
// path: "/pages/mine/subscribe/subscribe"
// },
{
id: 1, id: 1,
title: '用户服务&隐私协议', title: '用户服务&隐私协议',
icon: 'file-text', icon: 'file-text',
...@@ -64,4 +71,4 @@ export const shopSettingOptions = [{ ...@@ -64,4 +71,4 @@ export const shopSettingOptions = [{
value: 'phone', value: 'phone',
path: "/pages/mine/shop-setting/shop-phone/shop-phone" path: "/pages/mine/shop-setting/shop-phone/shop-phone"
} }
] ]
\ No newline at end of file
/** 自定义组件 共同逻辑 */
import {sceneOptions,} from "@/utils/config.js"
import {getList} from "@/api/mine/subscribe.js"
import { mapGetters } from 'vuex';
export default {
data() {
return {
scene:sceneOptions,
}
},
computed: {
...mapGetters(['loginChannel'])
},
methods: {
onCallback(callback) {
if (callback && callback instanceof Function) {
callback()
}
},
/**
* scene : 场景值
*/
getSubscribeMessage(scene) {
return new Promise(async(resolve,reject)=>{
let params={
channel:this.loginChannel,
scene:scene
}
try{
let {data} = await getList(params);
this.requestSubscribeMessage(data,resolve,reject)
}catch(e){
//TODO handle the exception
reject(e)
}
})
},
requestSubscribeMessage(tempList, resolve,reject) {
let tmplIds = tempList.map(item => item.outTempleId);
uni.requestSubscribeMessage({
tmplIds: tmplIds,
success: res => {
console.log(res);
this.saveSubscribeCount(tempList, res, resolve);
},
fail:err=> {
uni.showToast({
icon:'none',
title: '订阅失败'
});
console.log(err)
reject(err)
}
});
},
saveSubscribeCount(tempList, res, callback) {
let countList = [];
let rejectList = [];
if (tempList && res && tempList.length) {
tempList.forEach(item => {
if (res[item.outTempleId] && res[item.outTempleId] === 'accept') {
countList.push(item);
} else {
rejectList.push(item);
}
});
}
console.log(`发起 ${tempList.length} 项订阅 , 用户同意订阅 ${countList.length} 项 , 拒绝 ${rejectList.length} 项`);
// if (countList.length) {
// this.addCount(countList,callback);
// } else {
// this.onCallback(callback)
// }
resolve(res)
},
async addCount(tempList, callback){
try{
let params = tempList.map(item => item.id);
let res = await addSubscribeCount(this.camp_id, params);
this.onCallback(callback)
}catch(e){
//TODO handle the exception
this.onCallback(callback)
}
}
}
}
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