wangning 5 лет назад
Родитель
Сommit
cc036f88a0

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

@@ -94,7 +94,7 @@ export default { // 应用页面
             }, {
               name: "培训班",
               img: `${this.$constant.imgUrl}/ghs/home/yggl.png`,
-              url: "/training/trainingClass"
+              url: "/pagesStatistics/trainingClass"
             },
           ]
         },

+ 30 - 2
hdApp/src/api/product/index.js

@@ -40,8 +40,36 @@ export const getPxClassDataApi = data => {
 	return https.get("/px-class/list", data);
 };
 /** *
-	* 成品开单列表
-	*/
+	* 成品开单列表 
+*/
 export const getGoodsDataApi = data => {
 	return https.get("/goods/index", data);
 };
+
+/** *
+	* 培训班详情
+*/
+export const  pxClassDetail = data => {
+  return https.get("/px-class/detail", data);
+};
+  
+/** *
+	* 修改培训班   
+*/
+export const  pxClassUpdate = data => {
+  return https.get("/px-class/update", data);
+};
+
+/** *
+	* 新增培训班   
+*/
+export const  pxClassAdd = data => {
+  return https.get("/px-class/add", data);
+};
+
+/** *
+	* 删除培训班   
+*/
+export const  pxClassDel = data => {
+  return https.get("/px-class/del", data);
+};

+ 19 - 1
hdApp/src/pages.json

@@ -777,7 +777,25 @@
 						"navigationBarTitleText": "营业概况",
 						"enablePullDownRefresh": true
 					}
-				}
+				},
+        {
+          "path": "pagesPublicity",
+          "style": {
+            "navigationBarTitleText": ""
+          }
+        },
+        {
+          "path": "trainingClass",
+          "style": {
+            "navigationBarTitleText": "培训班"
+          }
+        },
+        {
+          "path": "trainingClassEdit",
+          "style": {
+            "navigationBarTitleText": "培训班编辑"
+          }
+        }
 			]
 		}
 	],

+ 92 - 0
hdApp/src/pagesStatistics/pagesPublicity.vue

@@ -0,0 +1,92 @@
+<template>
+  <view class="PublicItyPages">
+    <view class="viewTitle">开启微信提醒</view>
+    <view class="viewMain">
+      <text class="icon_num icon_one">1</text>
+      <text class="icon_num icon_two">2</text>
+      <text class="icon_num icon_three">3</text>
+      <view class="_title">点击框内右下方“开启微信提醒”卡片</view>
+      <view class="open_btn">打开聊天框</view>
+      <view class="_title">点击框内右下方“开启微信提醒”卡片</view>
+      <image
+        src="https://img.huaml.com/focus/send.png"
+        class="img_1"
+      />
+      <view class="_title">点击框内右下方“开启微信提醒”卡片</view>
+      <image
+        src="https://img.huaml.com/focus/qr_code.png"
+        class="img_1"
+      />
+    </view>
+  </view>
+</template>
+
+<style lang="scss" scoped>
+.PublicItyPages {
+  .viewTitle {
+    color: #040404;
+    font-size: 36upx;
+    font-weight: 700;
+    padding: 42upx 0 60upx 50upx;
+  }
+  .viewMain {
+    position: relative;
+    padding-left: 119upx;
+    &::after {
+      content: "";
+      position: absolute;
+      z-index: -1;
+      top: 0;
+      left: 68upx;
+      height: 995upx;
+      width: 1px;
+      border-left: 2px dashed #3385ff;
+    }
+    & > .icon_num {
+      position: absolute;
+      left: 49upx;
+      z-index: 9;
+      width: 40upx;
+      height: 40upx;
+      line-height: 40upx;
+      text-align: center;
+      font-size: 28upx;
+      font-weight: 700;
+      background-color: #3385ff;
+      border-radius: 50%;
+      color: #fff;
+    }
+    & > .icon_one {
+      top: 0upx;
+    }
+    & > .icon_two {
+      top: 285upx;
+    }
+    & > .icon_three {
+      top: 995upx;
+    }
+    & > ._title {
+      font-size: 32upx;
+      font-weight: 600;
+      color: #141f25;
+    }
+    & > .open_btn {
+      width: 580upx;
+      height: 90upx;
+      line-height: 90upx;
+      text-align: center;
+      font-size: 32upx;
+      color: #fff;
+      background: #3385ff;
+      border-radius: 8px;
+      margin: 67upx 0 85upx;
+    }
+    & > .img_1 {
+      margin: 34upx 0 71upx;
+      width: 382upx;
+      height: 566upx;
+      background-color: #eee;
+    }
+  }
+}
+</style>

+ 172 - 0
hdApp/src/pagesStatistics/trainingClass.vue

@@ -0,0 +1,172 @@
+<template>
+  <view class="shop-page">
+    <scroll-view
+      scroll-y
+      class="shop-list"
+    >
+      <view
+        class="shop-item"
+        v-for="(item, index) in shopList"
+        :key="index"
+      >
+        <image
+          class="avatar"
+          :src="item.cover"
+          alt="商品图"
+        />
+        <view class="info">
+          <view class="info-name">{{ item.name }}</view>
+          <view class="info-address">
+            ¥{{ item.tuition }}
+          </view>
+        </view>
+        <view :class="['edit']">
+          <text
+            class="iconfont iconbianji"
+            @click="editItem(item.id)"
+          > </text>
+          <text
+            class="iconfont iconshanchu1"
+            @click="delItem(item.id)"
+          > </text>
+        </view>
+      </view>
+    </scroll-view>
+    <view class="under-bar">
+      <button
+        :class="['admin-button-com', 'middle', 'blue']"
+        @click="addItem"
+      >
+        添加
+      </button>
+    </view>
+  </view>
+</template>
+<script>
+import { getPxClassDataApi, pxClassDel } from "@/api/product/index";
+export default {
+  components: {},
+  data () {
+    return {
+      shopList: []
+    };
+  },
+  mounted () {
+    this.getData()
+  },
+  methods: {
+    getData () {
+      getPxClassDataApi().then(res => {
+        console.log(res)
+        this.shopList = res.data.list
+      }).catch(err => { console.log(err) })
+    },
+    editItem (id) {
+      uni.navigateTo({
+        url: '/pagesStatistics/trainingClassEdit?id=' + id
+      })
+    },
+    addItem () {
+      uni.navigateTo({
+        url: '/pagesStatistics/trainingClassEdit'
+      })
+    },
+    delItem (id) {
+      let that = this
+      uni.showModal({
+        // title: '提示',
+        content: '确定要删除吗?',
+        success: function (res) {
+          if (res.confirm) {
+            console.log('用户点击确定');
+            pxClassDel({ id }).then(res => {
+              console.log(res)
+              that.getData()
+            }).catch(err => { console.log(err) })
+          } else if (res.cancel) {
+
+          }
+        }
+      });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.shop-page {
+  // height: 100%;
+  display: flex;
+  flex-direction: column;
+  background-color: #f9fbfc;
+  .under-bar {
+    position: fixed;
+    bottom: 0;
+    padding: 0 20upx;
+    display: flex;
+
+    flex-shrink: 0;
+    justify-content: flex-end;
+    align-items: center;
+    width: 100%;
+    height: 100upx;
+    background-color: #fff;
+  }
+  .shop-list {
+    margin-top: 20upx;
+    flex: 1;
+    padding-bottom: 100upx;
+    .shop-item {
+      margin-bottom: 20upx;
+      padding: 30upx;
+      display: flex;
+      align-items: center;
+      box-shadow: 0px 1px 0px 0px #eeeeee;
+      background-color: #fff;
+      .avatar {
+        width: 120upx;
+        height: 120upx;
+        image {
+          width: 100%;
+          height: 100%;
+          background-color: #eee;
+        }
+      }
+      .info {
+        flex: 1;
+        margin: 0 20px;
+        .info-name {
+          font-size: 28px;
+          font-family: PingFang SC;
+          font-weight: 400;
+          color: #333333;
+        }
+        .info-address {
+          margin-top: 15upx;
+          font-size: 30upx;
+          font-weight: 600;
+          color: #333333;
+        }
+      }
+      .edit {
+        display: flex;
+        align-items: center;
+        justify-content: space-around;
+        flex-shrink: 0;
+        .iconfont {
+          margin: 0 20upx;
+        }
+        .iconshoukuanma1 {
+          font-size: 40upx;
+          color: $mainColor;
+        }
+        .iconbianji {
+          font-size: 40upx;
+        }
+        .iconshanchu1 {
+          font-size: 40upx;
+        }
+      }
+    }
+  }
+}
+</style>

+ 317 - 0
hdApp/src/pagesStatistics/trainingClassEdit.vue

@@ -0,0 +1,317 @@
+<template>
+  <div class="app-content">
+    <!-- 门店信息 -->
+    <form
+      @submit="formSubmit"
+      @reset="formReset"
+    >
+      <!-- <div class="prompt-text">注: 请先关注公众号,绑定后可以在移动端自动登录</div> -->
+      <!-- 登录信息 -->
+      <div class="module-com input-line-wrap">
+        <tui-list-cell
+          class="line-cell"
+          :hover="false"
+        >
+          <div class="tui-title required">名称</div>
+          <input
+            v-model="form.name"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="name"
+            placeholder="请输入名称"
+            maxlength="50"
+            type="text"
+          />
+        </tui-list-cell>
+        <tui-list-cell
+          class="line-cell"
+          :hover="false"
+        >
+          <div class="tui-title required">价格</div>
+          <input
+            v-model="form.tuition"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="tuition"
+            placeholder="请输入价格"
+            maxlength="50"
+            type="text"
+          />
+        </tui-list-cell>
+        <tui-list-cell
+          class="line-cell"
+          :hover="false"
+        >
+          <div class="tui-title required">招生对象</div>
+          <input
+            v-model="form.target"
+            placeholder-class="phcolor"
+            class="tui-input"
+            name="target"
+            placeholder="请输入招生对象"
+            maxlength="50"
+            type="text"
+          />
+        </tui-list-cell>
+        <tui-list-cell
+          class="line-cell"
+          :hover="false"
+        >
+          <div class="tui-title">封面图</div>
+          <app-uploader
+            @resultData="_resultData"
+            :num="1"
+          />
+          <image
+            src="form.cover"
+            class="_thmist"
+            v-if="imgShow"
+          ></image>
+        </tui-list-cell>
+        <tui-list-cell
+          class="line-cell"
+          :hover="false"
+        >
+          <div class="tui-title">简介</div>
+          <textarea
+            name="summary"
+            id=""
+            cols="30"
+            rows="10"
+            placeholder="简介 . . ."
+            v-model="form.summary"
+          ></textarea>
+        </tui-list-cell>
+        <!-- <tui-list-cell
+          class="line-cell remark-wrap"
+          :hover="false"
+        >
+          <div class="tui-title">状态</div>
+          <div class="tui-input">
+            <radio-group
+              class="radio-group"
+              @change="radioChange"
+            >
+              <label
+                v-for="(item, index) in statusList"
+                :key="item.value"
+              >
+                <radio
+                  :value="item.value"
+                  :checked="item.value === form.status"
+                  :color="'#3385FF'"
+                />
+                <text>{{ item.name }}</text>
+              </label>
+            </radio-group>
+          </div>
+        </tui-list-cell> -->
+      </div>
+      <!-- 提交 -->
+      <div class="confirm-btn">
+        <button
+          class="admin-button-com big blue"
+          formType="submit"
+        >确认</button>
+      </div>
+    </form>
+    <!-- 选择地区 -->
+    <app-area-sel
+      :show.sync="showRegion"
+      :city="form.receiveCity"
+      @change="changeAreaFn"
+    />
+  </div>
+</template>
+
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import AppUploader from "@/components/app-uploader";
+const form = require("@/utils/formValidation.js");
+// api
+import { pxClassDetail, pxClassUpdate, pxClassAdd } from "@/api/product";
+export default {
+  name: "staff-add",
+  components: {
+    TuiListCell,
+    AppUploader
+  },
+  data () {
+    return {
+      form: {
+        name: "",
+        tuition: "",
+        introduction: "",
+        target: "",
+        status: "",
+        cover: '',
+        summary: ''
+      },
+      statusList: [
+        {
+          value: "01",
+          name: "上架"
+        },
+        {
+          value: "02",
+          name: "下架"
+        }
+      ],
+      imgShow: false
+    };
+  },
+  onLoad () {
+    // this.init()
+    console.log(this.option.id)
+  },
+  onShow () {
+    if (this.option.id) {
+      uni.setNavigationBarTitle({
+        title: `修改培训班`
+      });
+      this.imgShow = true
+    } else {
+      uni.setNavigationBarTitle({
+        title: `添加培训班`
+      });
+    }
+  },
+  methods: {
+    init () {
+      if (this.option.id) {
+        this._getDet();
+      }
+    },
+    _resultData (val) {
+      this.form.cover = val.shortUrl
+      this.imgShow = false
+    },
+    // api
+    _getDet () {
+      pxClassDetail({ id: this.option.id }).then(res => {
+        console.log(res)
+        this.form = res.data
+      }).catch(err => { console.log(err) })
+    },
+    radioChange: function (evt) {
+      for (let i = 0; i < this.statusList.length; i++) {
+        if (this.statusList[i].value === evt.target.value) {
+          this.form.status = evt.target.value;
+          break;
+        }
+      }
+    },
+    confirmFn () {
+      if (!this.form.cover) {
+        this.$msg('请上传头像')
+        return
+      }
+      let hostFn = this.option.id ? pxClassUpdate : pxClassAdd;
+      if (this.option.id) {
+        this.form.id = this.option.id;
+      }
+      hostFn(this.form).then(res => {
+        let promptText = this.option.id ? "修改成功!" : "添加成功!";
+        this.$msg(promptText);
+        setTimeout(() => {
+          this.$util.pageTo("/pagesStatistics/trainingClass");
+        }, 1000);
+      });
+    },
+    // 表单验证
+    formSubmit (e) {
+      // 表单规则
+      let rules = [
+        {
+          name: "name",
+          rule: ["required"],
+          msg: ["请输入名称"]
+        },
+        {
+          name: "tuition",
+          rule: ["required"],
+          msg: ["请输入价格"]
+        },
+        {
+          name: "target",
+          rule: ["required"],
+          msg: ["请输入招生对象"]
+        },
+        // {
+        //   name: "status",
+        //   rule: ["required"],
+        //   msg: ["请选择状态"]
+        // }
+        {
+          name: "summary",
+          rule: ["required"],
+          msg: ["请输入简介"]
+        }
+      ];
+      // 进行表单检查
+      let formData = e.detail.value;
+      let checkRes = form.validation(formData, rules);
+      // 验证通过!
+      if (!checkRes) {
+        this.confirmFn();
+      } else {
+        this.$msg(checkRes);
+      }
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 20px);
+  padding-top: 20px;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30px;
+  margin-bottom: 30px;
+}
+// ---
+.module-com {
+  margin-bottom: 20px;
+  .member-wrap {
+    .member-det {
+      font-size: 24px;
+      margin-left: 20px;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240px;
+    }
+  }
+}
+.radio-group {
+  display: flex;
+  label {
+    margin-right: 80upx;
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60px);
+  margin: 60px 30px 20px;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+textarea {
+  border: 1px solid #eee;
+  padding: 20upx;
+  font-size: 28px;
+}
+._thmist {
+  width: 200upx;
+  height: 200upx;
+  vertical-align: top;
+  background-color: #eee;
+  margin-top: -18upx;
+}
+</style>

+ 0 - 5
hdApp/src/training/trainingClass.vue

@@ -1,5 +0,0 @@
-<template>
-  <view>
-    123
-  </view>
-</template>