ソースを参照

新增:采购设置

shizhongqi 10 ヶ月 前
コミット
5bae959b0f

+ 136 - 0
hdApp/src/admin/cg/setting.vue

@@ -0,0 +1,136 @@
+<template>
+  <view class="app-content">
+    <view>
+      <view class="module-com input-line-wrap">
+        <tui-list-cell class="line-cell" :arrow="false">
+          <view class="tui-title">入库选项</view>
+          <view class="tui-right">
+            <switch :checked="form.cgIn == '0' ? false : true" @change="switchChangeFn('cgIn', $event)" />
+            {{ form.cgIn == '0' ? '不要入库' : '需要入库' }}
+          </view>
+        </tui-list-cell>
+        <tui-list-cell class="line-cell" :arrow="false">
+          <view class="tui-title">成本选项</view>
+          <view class="tui-right">
+            <switch :checked="form.cgIsCost == '0' ? false : true" @change="switchChangeFn('cgIsCost', $event)" />
+            {{ form.cgIsCost == '0' ? '不算成本' : '算成本' }}
+          </view>
+        </tui-list-cell>
+      </view>
+
+      <view class="tips">以上请勿随意修改,了解清楚再修改,否则出问题自行承担</view>
+      <view class="confirm-btn">
+        <button class="admin-button-com big blue" @click="formSubmit">提交</button>
+      </view>
+    </view>
+  </view>
+</template>
+<script>
+import TuiListCell from '@/components/plugin/list-cell';
+import { getExtInfo, modifyCgSetting  } from '@/api/shop/ext.js';
+export default {
+  name: 'set',
+  components: { TuiListCell },
+  data() {
+    return {
+      form: {
+        cgIn: '0',
+        cgIsCost: '0'
+      }
+    };
+  },
+  methods: {
+    init() {
+      getExtInfo({fields:'cgIn,cgIsCost'}).then((res) => {
+        if (res.code === 1) {
+          this.form = res.data.ext;
+          console.log(this.form);
+        }
+      });
+    },
+    formSubmit() {
+      modifyCgSetting(this.form).then((res) => {
+        if (res.code === 1) {
+          uni.showToast({
+            title: '操作成功',
+            icon: 'success',
+            duration: 2000
+          });
+          // setTimeout(() => {
+          //   uni.navigateBack({});
+          // }, 2000);
+        }else{
+          uni.showToast({
+            title: res.msg,
+            icon: 'none',
+            duration: 2000
+          });
+        }
+      });
+    },
+    switchChangeFn(key, e) {
+      this.form[key] = e.detail.value ? '1' : '0';
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 40rpx);
+  padding-top: 2rpx;
+}
+.tui-right {
+  display: flex;
+  align-items: center;
+  font-size: 28rpx;
+  color: #333;
+
+  ::v-deep switch {
+    margin-left: 20rpx;
+  }
+}
+.tips {
+  padding: 0 30rpx;
+  color: red;
+  font-size: 28rpx;
+  margin-bottom: 40rpx;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30rpx;
+  margin-bottom: 30rpx;
+}
+.module-com {
+  margin-bottom: 20rpx;
+  ::v-deep .tui-list-cell {
+    padding: 20rpx 30rpx;
+    &:first-child {
+      border-bottom: 1rpx solid #eee;
+    }
+  }
+  .member-wrap {
+    .member-det {
+      font-size: 24rpx;
+      margin-left: 20rpx;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240rpx;
+    }
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60rpx);
+  margin: 60rpx 30rpx;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+.switch-blo {
+  padding: 30rpx 30rpx;
+}
+</style>

+ 2 - 1
hdApp/src/admin/home/apply.vue

@@ -64,7 +64,8 @@ export default {
             { name: "失信人员", img: `${this.$constant.hostUrl}/image/ghs/home/shop2.png`, url: "/admin/ll/list",pf:1},
             { name: "会员等级", img: `${this.$constant.hostUrl}/image/ghs/home/shop2.png`, url: "/admin/member/level",pf:1},
             { name: "充值规则", img: `${this.$constant.hostUrl}/image/ghs/home/shop2.png`, url: "/admin/recharge/discount",pf:1},
-            { name: "收款码", img: `${this.$constant.hostUrl}/image/ghs/home/shop2.png`, url: "/admin/cg/code",pf:1}
+            { name: "收款码", img: `${this.$constant.hostUrl}/image/ghs/home/shop2.png`, url: "/admin/cg/code",pf:1},
+            { name: "采购设置", img: `${this.$constant.hostUrl}/image/ghs/home/shop2.png`, url: "/admin/cg/setting",pf:1}
           ]
         },
         {

+ 4 - 0
hdApp/src/api/shop/ext.js

@@ -18,4 +18,8 @@ export const getExtInfo = data => {
 
 export const setItem = data => {
 	return https.post('/shop-ext/set-item', data)
+}
+
+export const modifyCgSetting = data => {
+	return https.post('/shop-ext/modify-cg-setting', data)
 }

+ 2 - 1
hdApp/src/pages.json

@@ -116,7 +116,8 @@
 				{ "path": "mall", "style": { "navigationBarTitleText": "商城" } },
 				{ "path": "code", "style": { "navigationBarTitleText": "收款码" } },
 				{ "path": "member", "style": { "navigationBarTitleText": "注册会员码" } },
-				{ "path": "alipay", "style": { "navigationBarTitleText": "付款" } }
+				{ "path": "alipay", "style": { "navigationBarTitleText": "付款" } },
+				{ "path": "setting", "style": { "navigationBarTitleText": "采购设置" } }
 			]
 		},
 		{