Browse Source

✨ feat: 增加目标乐跑次数功能

Pchen. 5 months ago
parent
commit
d2dff9fced

+ 1 - 1
.env

@@ -1,4 +1,4 @@
 NODE_ENV=production
 NODE_ENV=production
 VITE_APP_API_BASE_URL=https://lepao-api.xxoo365.top
 VITE_APP_API_BASE_URL=https://lepao-api.xxoo365.top
 VITE_RSA_PUBLIC_KEY=LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF6Z1lGYzVRMGVqbTh4akZsSjdMSQpBZDJGeC9TalM0OWQ5emwyZHlaNzNDMGZLU3Fuc1pJQUZkREpWZWV6bUp6T1hOWFdoYVZHaHFwM0dCUWVvcDBKClIxekZ3bUs1em9ReElTTDc5WVF3SmxoSjdaellhL0xNcGtGZDRDVFQ4UzUwTGFzN1FpcUtqRE1BQjFLZEpaTnIKNE5HcjNUWVV4MVVpTzlUTW9YV3lBdFZRQVN2a3lFSVFIb3B4T2Vod0ZuNGRhVE8vLzF5TXRyNnZoclE4enJRMwpxUG01YWJmY0lRM3B1WDVJd1MrekRmSkI5Rm9rc0paa3RWNHI2KzM2U1E3WGp2MDFBQjJvK20yejZqNzNuWjQ1Ci95TEx5NmZHTG5lTWpTaUxHMDhNUWFCUjV1dTNITTRnMkpnanA4eU10Rkg1Tkc5Zys1dXRhTDNzd3JGQjhxd1UKdFFJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==
 VITE_RSA_PUBLIC_KEY=LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUF6Z1lGYzVRMGVqbTh4akZsSjdMSQpBZDJGeC9TalM0OWQ5emwyZHlaNzNDMGZLU3Fuc1pJQUZkREpWZWV6bUp6T1hOWFdoYVZHaHFwM0dCUWVvcDBKClIxekZ3bUs1em9ReElTTDc5WVF3SmxoSjdaellhL0xNcGtGZDRDVFQ4UzUwTGFzN1FpcUtqRE1BQjFLZEpaTnIKNE5HcjNUWVV4MVVpTzlUTW9YV3lBdFZRQVN2a3lFSVFIb3B4T2Vod0ZuNGRhVE8vLzF5TXRyNnZoclE4enJRMwpxUG01YWJmY0lRM3B1WDVJd1MrekRmSkI5Rm9rc0paa3RWNHI2KzM2U1E3WGp2MDFBQjJvK20yejZqNzNuWjQ1Ci95TEx5NmZHTG5lTWpTaUxHMDhNUWFCUjV1dTNITTRnMkpnanA4eU10Rkg1Tkc5Zys1dXRhTDNzd3JGQjhxd1UKdFFJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==
-VITE_APP_VERSION=1.6
+VITE_APP_VERSION=1.7

+ 20 - 10
src/pages/admin/lepaoAccount/accountList.vue

@@ -104,7 +104,8 @@
                     {{ record.sex === 1 ? '男' : (record.sex === 2 ? '女' : '') }}
                     {{ record.sex === 1 ? '男' : (record.sex === 2 ? '女' : '') }}
                 </template>
                 </template>
                 <template #auto_run="{ record }">
                 <template #auto_run="{ record }">
-                    <a-tag color="green" v-if="record.auto_run">开启</a-tag>
+                    <a-tag color="green" v-if="record.auto_run">{{ record.target_count === 0 ? '开启-不限' :
+                        `开启-${record.target_count}次` }}</a-tag>
                     <a-tag color="red" v-else>关闭</a-tag>
                     <a-tag color="red" v-else>关闭</a-tag>
                 </template>
                 </template>
                 <template #num="{ record }">
                 <template #num="{ record }">
@@ -182,7 +183,13 @@
             <a-form-item field="auto_run" label="自动乐跑开关">
             <a-form-item field="auto_run" label="自动乐跑开关">
                 <a-switch v-model="form.auto_run" :checked-value="1" :unchecked-value="0" />
                 <a-switch v-model="form.auto_run" :checked-value="1" :unchecked-value="0" />
             </a-form-item>
             </a-form-item>
-            <a-form-item field="auto_time" label="自动乐跑时段">
+            <a-form-item field="target_count" label="乐跑目标次数" v-if="form.auto_run">
+                <a-input-number v-model="form.target_count" placeholder="请输入乐跑目标次数" mode="button" />
+                <template #extra>
+                    <div>当学期有效次数达到目标次数时自动乐跑将关闭,0为不限次</div>
+                </template>
+            </a-form-item>
+            <a-form-item field="auto_time" label="自动乐跑时段" v-if="form.auto_run">
                 <a-select v-model="form.auto_time" placeholder="请选择每天自动乐跑的时段" :options="auto_time" />
                 <a-select v-model="form.auto_time" placeholder="请选择每天自动乐跑的时段" :options="auto_time" />
             </a-form-item>
             </a-form-item>
             <a-form-item field="notes" label="备注">
             <a-form-item field="notes" label="备注">
@@ -228,6 +235,7 @@ const form = reactive({
     area: '',
     area: '',
     auto_run: 1,
     auto_run: 1,
     auto_time: -1,
     auto_time: -1,
+    target_count: 30,
     notes: ''
     notes: ''
 })
 })
 
 
@@ -244,7 +252,7 @@ const columns = [
         title: 'ID',
         title: 'ID',
         dataIndex: 'id',
         dataIndex: 'id',
         fixed: 'left',
         fixed: 'left',
-        width: 60
+        width: 65
     }, {
     }, {
         title: '创建用户',
         title: '创建用户',
         slotName: 'create_user',
         slotName: 'create_user',
@@ -278,10 +286,6 @@ const columns = [
         title: '乐跑跑区',
         title: '乐跑跑区',
         dataIndex: 'area',
         dataIndex: 'area',
         width: 150
         width: 150
-    }, {
-        title: '累计次数',
-        slotName: 'num',
-        width: 90
     }, {
     }, {
         title: '自动乐跑',
         title: '自动乐跑',
         slotName: 'auto_run',
         slotName: 'auto_run',
@@ -290,6 +294,10 @@ const columns = [
         title: '自动乐跑时段',
         title: '自动乐跑时段',
         slotName: 'auto_time',
         slotName: 'auto_time',
         width: 130
         width: 130
+    }, {
+        title: '学期目标',
+        slotName: 'num',
+        width: 90
     }, {
     }, {
         title: '帐号状态',
         title: '帐号状态',
         slotName: 'state',
         slotName: 'state',
@@ -344,7 +352,7 @@ const getAccounts = async () => {
         const res = await adminAccountList(reqData)
         const res = await adminAccountList(reqData)
         if (!res || res.code !== 0)
         if (!res || res.code !== 0)
             return Notification.error({
             return Notification.error({
-                title: '获取路径数据失败!',
+                title: '获取账号数据失败!',
                 content: res?.msg ?? '请稍后再试'
                 content: res?.msg ?? '请稍后再试'
             })
             })
 
 
@@ -352,7 +360,7 @@ const getAccounts = async () => {
         pagination.total = res.pagination.total
         pagination.total = res.pagination.total
     } catch (error) {
     } catch (error) {
         Notification.error({
         Notification.error({
-            title: '获取路径数据失败!',
+            title: '获取账号数据失败!',
             content: error.message || '请稍后再试'
             content: error.message || '请稍后再试'
         })
         })
     } finally {
     } finally {
@@ -368,12 +376,14 @@ const editAccount = (item) => {
         form.area = item.area
         form.area = item.area
         form.auto_run = item.auto_run
         form.auto_run = item.auto_run
         form.auto_time = item.auto_time
         form.auto_time = item.auto_time
+        form.target_count = item.target_count
         form.notes = item.notes
         form.notes = item.notes
     } else {
     } else {
         form.id = null
         form.id = null
         form.student_num = ''
         form.student_num = ''
         form.auto_run = 1
         form.auto_run = 1
         form.auto_time = 7
         form.auto_time = 7
+        form.target_count = 30
         form.email = email.value
         form.email = email.value
         form.notes = ''
         form.notes = ''
     }
     }
@@ -517,7 +527,7 @@ const stramptoTime = (time) => {
 }
 }
 
 
 const auto_time = [
 const auto_time = [
-    { label: '随机时段', value: -1 },
+    { label: '随机', value: -1 },
     ...Array.from({ length: 17 }, (_, i) => {
     ...Array.from({ length: 17 }, (_, i) => {
         const hour = i + 7
         const hour = i + 7
         return { label: `${hour} ~ ${hour + 1}时`, value: hour }
         return { label: `${hour} ~ ${hour + 1}时`, value: hour }

+ 15 - 5
src/pages/lepao/accountList/index.vue

@@ -179,7 +179,7 @@
               </div>
               </div>
             </template>
             </template>
           </a-table-column> -->
           </a-table-column> -->
-          <a-table-column title="自动乐跑" :width="100" ellipsis tooltip :filterable="{
+          <a-table-column title="自动乐跑" :width="105" ellipsis tooltip :filterable="{
             filters: [
             filters: [
               { text: '开启', value: 1 },
               { text: '开启', value: 1 },
               { text: '关闭', value: 0 }
               { text: '关闭', value: 0 }
@@ -187,7 +187,8 @@
             filter: (value, record) => record.auto_run == value
             filter: (value, record) => record.auto_run == value
           }">
           }">
             <template #cell="{ record }">
             <template #cell="{ record }">
-              <a-tag color="green" v-if="record.auto_run">开启</a-tag>
+              <a-tag color="green" v-if="record.auto_run">{{ record.target_count === 0 ? '开启-不限' :
+                `开启-${record.target_count}次` }}</a-tag>
               <a-tag color="red" v-else>关闭</a-tag>
               <a-tag color="red" v-else>关闭</a-tag>
             </template>
             </template>
           </a-table-column>
           </a-table-column>
@@ -196,7 +197,7 @@
               {{ autoTimeLabel(record) }}
               {{ autoTimeLabel(record) }}
             </template>
             </template>
           </a-table-column>
           </a-table-column>
-          <a-table-column title="累计次数" :width="88" ellipsis tooltip>
+          <a-table-column title="学期目标" :width="88" ellipsis tooltip>
             <template #cell="{ record }">
             <template #cell="{ record }">
               {{ record.term_num != record.total_num ? `${record.total_num} / ${record.term_num}` :
               {{ record.term_num != record.total_num ? `${record.total_num} / ${record.term_num}` :
                 '已完成' }}
                 '已完成' }}
@@ -265,7 +266,13 @@
       <a-form-item field="auto_run" label="自动乐跑开关">
       <a-form-item field="auto_run" label="自动乐跑开关">
         <a-switch v-model="form.auto_run" :checked-value="1" :unchecked-value="0" />
         <a-switch v-model="form.auto_run" :checked-value="1" :unchecked-value="0" />
       </a-form-item>
       </a-form-item>
-      <a-form-item field="area" label="自动乐跑时段">
+      <a-form-item field="target_count" label="乐跑目标次数" v-if="form.auto_run">
+        <a-input-number v-model="form.target_count" placeholder="请输入乐跑目标次数" mode="button" />
+        <template #extra>
+          <div>当学期有效次数达到目标次数时自动乐跑将关闭,0为不限次</div>
+        </template>
+      </a-form-item>
+      <a-form-item field="auto_time" label="自动乐跑时段" v-if="form.auto_run">
         <a-select v-model="form.auto_time" placeholder="请选择每天自动乐跑的时段" :options="auto_time" />
         <a-select v-model="form.auto_time" placeholder="请选择每天自动乐跑的时段" :options="auto_time" />
       </a-form-item>
       </a-form-item>
       <a-form-item field="notes" label="备注">
       <a-form-item field="notes" label="备注">
@@ -392,7 +399,7 @@ const handlePageSizeChange = (size) => {
 }
 }
 
 
 const auto_time = [
 const auto_time = [
-  { label: '随机时段', value: -1 },
+  { label: '随机分配', value: -1 },
   ...Array.from({ length: 17 }, (_, i) => {
   ...Array.from({ length: 17 }, (_, i) => {
     const hour = i + 7
     const hour = i + 7
     return { label: `${hour} ~ ${hour + 1}时`, value: hour }
     return { label: `${hour} ~ ${hour + 1}时`, value: hour }
@@ -420,6 +427,7 @@ const form = reactive({
   area: '',
   area: '',
   auto_time: -1,
   auto_time: -1,
   auto_run: 1,
   auto_run: 1,
+  target_count: 30,
   notes: ''
   notes: ''
 })
 })
 
 
@@ -441,6 +449,7 @@ const editAccount = (item) => {
     form.area = item.area
     form.area = item.area
     form.auto_time = item.auto_time
     form.auto_time = item.auto_time
     form.auto_run = item.auto_run
     form.auto_run = item.auto_run
+    form.target_count = item.target_count
     form.notes = item.notes
     form.notes = item.notes
   } else {
   } else {
     form.id = null
     form.id = null
@@ -448,6 +457,7 @@ const editAccount = (item) => {
     form.email = ''
     form.email = ''
     form.auto_run = 1
     form.auto_run = 1
     form.auto_time = -1
     form.auto_time = -1
+    form.target_count = 30
     form.area = ''
     form.area = ''
     form.notes = ''
     form.notes = ''
   }
   }

+ 1 - 1
src/pages/store/orders/orderDetail/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div class="container">
   <div class="container">
-    <Breadcrumb :items="['Forge商城', '订单详情']" />
+    <Breadcrumb :items="['商城', '订单详情']" />
     <a-space direction="vertical" :size="16" fill>
     <a-space direction="vertical" :size="16" fill>
       <a-card class="general-card" title="订单状态">
       <a-card class="general-card" title="订单状态">
         <div class="step">
         <div class="step">