|
@@ -57,6 +57,31 @@
|
|
|
<text class="offset-hint" v-if="offsetHint">{{ offsetHint }}</text>
|
|
<text class="offset-hint" v-if="offsetHint">{{ offsetHint }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+ <!-- 完成表扬开关 -->
|
|
|
|
|
+ <view class="cfg-card">
|
|
|
|
|
+ <view class="cfg-card-header">
|
|
|
|
|
+ <text class="cfg-card-title">任务完成鼓励</text>
|
|
|
|
|
+ <text class="cfg-switch" :class="{ 'cfg-switch-on': completionPraiseEnabled === 1 }" @tap="togglePraiseEnabled">
|
|
|
|
|
+ <text class="cfg-switch-text">{{ completionPraiseEnabled === 1 ? '已开启' : '已关闭' }}</text>
|
|
|
|
|
+ </text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <text class="cfg-card-desc">任务正常完成时,发送表扬鼓励消息</text>
|
|
|
|
|
+ <view class="channel-list" v-if="completionPraiseEnabled === 1" style="margin-top:20rpx">
|
|
|
|
|
+ <view class="channel-item" v-for="ch in channels" :key="'p-'+ch.type"
|
|
|
|
|
+ :class="{
|
|
|
|
|
+ 'channel-selected': isPraiseSelected(ch.type),
|
|
|
|
|
+ 'channel-disabled': !ch.available
|
|
|
|
|
+ }"
|
|
|
|
|
+ @tap="togglePraiseChannel(ch)">
|
|
|
|
|
+ <view class="channel-check" v-if="isPraiseSelected(ch.type) && ch.available">✓</view>
|
|
|
|
|
+ <view class="channel-info">
|
|
|
|
|
+ <text class="channel-name">{{ ch.label }}</text>
|
|
|
|
|
+ <text class="channel-reason" v-if="!ch.available">{{ ch.reason || '未开通' }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
<!-- 站内消息兜底说明 -->
|
|
<!-- 站内消息兜底说明 -->
|
|
|
<view class="tip-card">
|
|
<view class="tip-card">
|
|
|
<text class="tip-text">💡 站内消息提醒始终开启,作为兜底通道不随以上设置关闭</text>
|
|
<text class="tip-text">💡 站内消息提醒始终开启,作为兜底通道不随以上设置关闭</text>
|
|
@@ -85,6 +110,8 @@ export default {
|
|
|
selectedChannels: [],
|
|
selectedChannels: [],
|
|
|
timingMode: 'after_timeout',
|
|
timingMode: 'after_timeout',
|
|
|
offsetMinutes: 60,
|
|
offsetMinutes: 60,
|
|
|
|
|
+ completionPraiseEnabled: 0,
|
|
|
|
|
+ selectedPraiseChannels: ['wechat', 'in_app'],
|
|
|
_loaded: false
|
|
_loaded: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -124,6 +151,8 @@ export default {
|
|
|
self.channels = Array.isArray(d.availableChannels) ? d.availableChannels.filter(function(c) {
|
|
self.channels = Array.isArray(d.availableChannels) ? d.availableChannels.filter(function(c) {
|
|
|
return c && c.type !== 'in_app'
|
|
return c && c.type !== 'in_app'
|
|
|
}) : []
|
|
}) : []
|
|
|
|
|
+ self.completionPraiseEnabled = d.completionPraiseEnabled === 1 ? 1 : 0
|
|
|
|
|
+ self.selectedPraiseChannels = Array.isArray(d.completionPraiseChannels) ? d.completionPraiseChannels.slice() : ['wechat', 'in_app']
|
|
|
}
|
|
}
|
|
|
}).catch(function() {
|
|
}).catch(function() {
|
|
|
self.loading = false
|
|
self.loading = false
|
|
@@ -134,9 +163,15 @@ export default {
|
|
|
toggleEnabled: function() {
|
|
toggleEnabled: function() {
|
|
|
this.enabled = this.enabled === 1 ? 0 : 1
|
|
this.enabled = this.enabled === 1 ? 0 : 1
|
|
|
},
|
|
},
|
|
|
|
|
+ togglePraiseEnabled: function() {
|
|
|
|
|
+ this.completionPraiseEnabled = this.completionPraiseEnabled === 1 ? 0 : 1
|
|
|
|
|
+ },
|
|
|
isSelected: function(type) {
|
|
isSelected: function(type) {
|
|
|
return (this.selectedChannels || []).indexOf(type) >= 0
|
|
return (this.selectedChannels || []).indexOf(type) >= 0
|
|
|
},
|
|
},
|
|
|
|
|
+ isPraiseSelected: function(type) {
|
|
|
|
|
+ return (this.selectedPraiseChannels || []).indexOf(type) >= 0
|
|
|
|
|
+ },
|
|
|
toggleChannel: function(ch) {
|
|
toggleChannel: function(ch) {
|
|
|
if (!ch.available) return
|
|
if (!ch.available) return
|
|
|
var idx = this.selectedChannels.indexOf(ch.type)
|
|
var idx = this.selectedChannels.indexOf(ch.type)
|
|
@@ -146,6 +181,15 @@ export default {
|
|
|
this.selectedChannels.push(ch.type)
|
|
this.selectedChannels.push(ch.type)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ togglePraiseChannel: function(ch) {
|
|
|
|
|
+ if (!ch.available) return
|
|
|
|
|
+ var idx = this.selectedPraiseChannels.indexOf(ch.type)
|
|
|
|
|
+ if (idx >= 0) {
|
|
|
|
|
+ this.selectedPraiseChannels.splice(idx, 1)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.selectedPraiseChannels.push(ch.type)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
switchTiming: function(mode) {
|
|
switchTiming: function(mode) {
|
|
|
this.timingMode = mode
|
|
this.timingMode = mode
|
|
|
},
|
|
},
|
|
@@ -171,7 +215,9 @@ export default {
|
|
|
channels: this.selectedChannels.slice(),
|
|
channels: this.selectedChannels.slice(),
|
|
|
timingMode: this.timingMode,
|
|
timingMode: this.timingMode,
|
|
|
offsetMinutes: offset,
|
|
offsetMinutes: offset,
|
|
|
- enabled: this.enabled === 1 ? 1 : 0
|
|
|
|
|
|
|
+ enabled: this.enabled === 1 ? 1 : 0,
|
|
|
|
|
+ completionPraiseEnabled: this.completionPraiseEnabled === 1 ? 1 : 0,
|
|
|
|
|
+ completionPraiseChannels: this.selectedPraiseChannels.slice()
|
|
|
}).then(function(res) {
|
|
}).then(function(res) {
|
|
|
self.saving = false
|
|
self.saving = false
|
|
|
if (res && res.code === 200) {
|
|
if (res && res.code === 200) {
|
|
@@ -190,208 +236,3 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
-
|
|
|
|
|
-<style scoped>
|
|
|
|
|
-.reminder-config-page {
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- min-height: 100vh;
|
|
|
|
|
- background: #F5F9FC;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
-}
|
|
|
|
|
-.content {
|
|
|
|
|
- padding: 30rpx;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
-}
|
|
|
|
|
-.cfg-card {
|
|
|
|
|
- background-color: #FFFFFF;
|
|
|
|
|
- border-radius: 24rpx;
|
|
|
|
|
- padding: 30rpx;
|
|
|
|
|
- margin-bottom: 30rpx;
|
|
|
|
|
- box-shadow: 0 4rpx 16rpx rgba(91, 155, 213, 0.08);
|
|
|
|
|
-}
|
|
|
|
|
-.cfg-card-header {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: space-between;
|
|
|
|
|
-}
|
|
|
|
|
-.cfg-card-title {
|
|
|
|
|
- font-size: 30rpx;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- color: #1E293B;
|
|
|
|
|
-}
|
|
|
|
|
-.cfg-card-desc {
|
|
|
|
|
- display: block;
|
|
|
|
|
- margin-top: 12rpx;
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- color: #94A3B8;
|
|
|
|
|
- line-height: 1.6;
|
|
|
|
|
-}
|
|
|
|
|
-.cfg-switch {
|
|
|
|
|
- padding: 10rpx 28rpx;
|
|
|
|
|
- border-radius: 999rpx;
|
|
|
|
|
- font-size: 26rpx;
|
|
|
|
|
- background: #E2E8F0;
|
|
|
|
|
- color: #64748B;
|
|
|
|
|
-}
|
|
|
|
|
-.cfg-switch-on {
|
|
|
|
|
- background: linear-gradient(135deg, #5B9BD5, #8FC5E8);
|
|
|
|
|
- color: #FFFFFF;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-list {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- gap: 20rpx;
|
|
|
|
|
- margin-top: 24rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-item {
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- position: relative;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- padding: 16rpx 24rpx;
|
|
|
|
|
- border: 2rpx solid #E2E8F0;
|
|
|
|
|
- border-radius: 20rpx;
|
|
|
|
|
- background: #FFFFFF;
|
|
|
|
|
- min-width: 200rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-selected {
|
|
|
|
|
- border-color: #5B9BD5;
|
|
|
|
|
- background: #5B9BD5;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-disabled {
|
|
|
|
|
- opacity: 0.55;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-check {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: -8rpx;
|
|
|
|
|
- right: -8rpx;
|
|
|
|
|
- width: 32rpx;
|
|
|
|
|
- height: 32rpx;
|
|
|
|
|
- border-radius: 50%;
|
|
|
|
|
- background-color: #FFFFFF;
|
|
|
|
|
- color: #5B9BD5;
|
|
|
|
|
- font-size: 20rpx;
|
|
|
|
|
- font-weight: 900;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- z-index: 2;
|
|
|
|
|
- box-shadow: 0 2rpx 4rpx rgba(0,0,0,0.1);
|
|
|
|
|
-}
|
|
|
|
|
-.channel-info {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- gap: 6rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-name {
|
|
|
|
|
- font-size: 26rpx;
|
|
|
|
|
- color: #1E293B;
|
|
|
|
|
- font-weight: 500;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-selected .channel-name {
|
|
|
|
|
- color: #FFFFFF;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-reason {
|
|
|
|
|
- font-size: 20rpx;
|
|
|
|
|
- color: #94A3B8;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-tip {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- margin-top: 16rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.channel-tip-text {
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- color: #5B9BD5;
|
|
|
|
|
-}
|
|
|
|
|
-.timing-list {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- gap: 20rpx;
|
|
|
|
|
- margin-top: 24rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.timing-item {
|
|
|
|
|
- flex: 1;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- padding: 24rpx;
|
|
|
|
|
- border: 2rpx solid #E2E8F0;
|
|
|
|
|
- border-radius: 20rpx;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- gap: 8rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.timing-active {
|
|
|
|
|
- border-color: #5B9BD5;
|
|
|
|
|
- background: #F0F7FF;
|
|
|
|
|
-}
|
|
|
|
|
-.timing-name {
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- color: #1E293B;
|
|
|
|
|
-}
|
|
|
|
|
-.timing-active .timing-name {
|
|
|
|
|
- color: #3A7CC4;
|
|
|
|
|
-}
|
|
|
|
|
-.timing-desc {
|
|
|
|
|
- font-size: 22rpx;
|
|
|
|
|
- color: #94A3B8;
|
|
|
|
|
-}
|
|
|
|
|
-.offset-row {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- margin-top: 30rpx;
|
|
|
|
|
- padding: 20rpx 24rpx;
|
|
|
|
|
- background: #F8FAFC;
|
|
|
|
|
- border-radius: 16rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.offset-label {
|
|
|
|
|
- font-size: 26rpx;
|
|
|
|
|
- color: #1E293B;
|
|
|
|
|
- margin-right: 20rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.offset-input {
|
|
|
|
|
- flex: 1;
|
|
|
|
|
- font-size: 28rpx;
|
|
|
|
|
- color: #1E293B;
|
|
|
|
|
-}
|
|
|
|
|
-.offset-unit {
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- color: #94A3B8;
|
|
|
|
|
- margin-left: 12rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.offset-hint {
|
|
|
|
|
- display: block;
|
|
|
|
|
- margin-top: 12rpx;
|
|
|
|
|
- font-size: 22rpx;
|
|
|
|
|
- color: #94A3B8;
|
|
|
|
|
-}
|
|
|
|
|
-.tip-card {
|
|
|
|
|
- background: #D6EAF8;
|
|
|
|
|
- border-radius: 16rpx;
|
|
|
|
|
- padding: 24rpx 30rpx;
|
|
|
|
|
- margin-bottom: 30rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.tip-text {
|
|
|
|
|
- font-size: 24rpx;
|
|
|
|
|
- color: #3A7CC4;
|
|
|
|
|
- line-height: 1.6;
|
|
|
|
|
-}
|
|
|
|
|
-.save-area {
|
|
|
|
|
- padding: 40rpx 30rpx;
|
|
|
|
|
-}
|
|
|
|
|
-.save-btn {
|
|
|
|
|
- background: linear-gradient(135deg, #5B9BD5, #3A7CC4);
|
|
|
|
|
- color: #FFFFFF;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- padding: 28rpx 0;
|
|
|
|
|
- border-radius: 999rpx;
|
|
|
|
|
- font-size: 30rpx;
|
|
|
|
|
- font-weight: 600;
|
|
|
|
|
- box-shadow: 0 6rpx 20rpx rgba(91, 155, 213, 0.3);
|
|
|
|
|
-}
|
|
|
|
|
-.save-btn:active {
|
|
|
|
|
- opacity: 0.9;
|
|
|
|
|
- transform: scale(0.98);
|
|
|
|
|
-}
|
|
|
|
|
-</style>
|
|
|