123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <template>
- <view class="page">
- <view class="step">
- <uni-steps active-color="#07c160" :options="options" :active="4"></uni-steps>
- </view>
- <view style="height: 130rpx;"></view>
- <view class="home">
- <form @submit="addVersion">
- <view class="homeForm ft28">
- <picker mode="selector" :range="tableTypeList" range-key="title" @change="onTableTypeChange">
- <view class="item flex-y-center box-pack-between">
- <text>门店id(仅限审核使用)</text>
- <view>
- <text>{{tableTypeActive}}</text>
- <text class="iconfont icongengduo" style="font-size: 26rpx;"></text>
- </view>
- </view>
- </picker>
- <picker mode="selector" :range="tableList" range-key="id" @change="onTableChange">
- <view class="item flex-y-center box-pack-between">
- <text>位置id(仅限审核使用): </text>
- <view>
- <text>{{table_id}}</text>
- <text class="iconfont icongengduo" style="font-size: 26rpx;"></text>
- </view>
- <input type="text" :value="table_id" name="table_id" placeholder="请输入餐桌id"
- class="hide-input" />
- </view>
- </picker>
- <view class="item flex-y-center box-pack-between">
- <text>版本号:</text>
- <view class="border">
- <input type="text" :value="obj.user_version" name="user_version" placeholder="请输入版本号" />
- </view>
- </view>
- <view class="item box-pack-between" style="height: auto;padding: 20rpx 0;">
- <text class="flex-center" style="min-width:150rpx;">项目备注:</text>
- <view class="border itemTextarea flex-grow-1">
- <textarea type="text" auto-height="true" :value="obj.user_desc" name="user_desc"
- placeholder="请输入项目备注" />
- </view>
- </view>
- <!--
- <view class="tip">
- Tip:进入门店列表(对应审核门店id)>进入餐桌管理>即可找到餐桌ID。提交的版本号需大于当前版本号。
- </view> -->
- <button hover-class="none" form-type="submit" class="flex-grow-1 flex-center submit ft28">
- 提交版本
- </button>
- </view>
- </form>
- </view>
- </view>
- </template>
- <script>
- import optionsData from './data.js'
- export default {
- data() {
- return {
- tableTypeList: [],
- tableTypeActive: "请选择",
- table_id: "",
- store_id: '',
- obj: {},
- tableList: [],
- options:optionsData.options
- }
- },
- onLoad() {
- this.MiniVersion();
- },
- methods: {
- addVersion(e) {
- let {
- table_id,
- user_version,
- user_desc
- } = e.detail.value;
- this.request({
- url: 'setting/uploadCode',
- data: {
- admin_id: uni.getStorageSync("admin_id"),
- store_id: this.store_id,
- table_id,
- user_version,
- user_desc,
- }
- }).then(res => {
- if (res.code == '200') {
- console.log(res, "showModal")
- uni.showModal({
- title: '提示',
- content: res.message,
- showCancel: true,
- cancelText: '关闭',
- confirmText: '提交审核',
- success: r => {
- if (r.confirm) {
- uni.redirectTo({
- url: "./Versioning"
- })
- } else {
- uni.navigateBack({
- delta: 1
- })
- }
- },
- fail: () => {},
- complete: () => {}
- });
- }
- })
- },
- onTableTypeChange(e) {
- let store_id = this.tableTypeList[e.detail.value].id
- if (store_id != this.store_id) {
- this.tableTypeActive = this.tableTypeList[e.detail.value].title;
- this.store_id = store_id
- this.table_id = ""
- this.getTableList(this.store_id)
- }
- },
- onTableChange(e) {
- let table_id = this.tableList[e.detail.value].id
- this.table_id = table_id
- },
- // 版本列表
- MiniVersion(e) {
- this.request({
- url: 'setting/wechat_infos',
- data: {
- admin_id: uni.getStorageSync("admin_id"),
- }
- }).then(res => {
- if (res.code == 200) {
- this.obj = res.data
- this.shop_store_index();
- }
- })
- },
- shop_store_index() {
- this.request({
- url: 'Smdcshop/shop_store_index',
- data: {
- admin_id: uni.getStorageSync("admin_id"),
- }
- }).then(res => {
- if (res.code == 200) {
- this.tableTypeList = res.data;
- if (this.obj.store_id) {
- let info = res.data.find((item) => item.id == this.obj.store_id)
- this.tableTypeActive = info.title;
- this.store_id = info.id;
- } else {
- this.tableTypeActive = res.data[0].title;
- this.store_id = res.data[0].id;
- }
- if(this.obj.table_id){
- this.table_id = this.obj.table_id
- }
- this.getTableList(this.store_id)
- }
- })
- },
- getTableList(store_id) {
- this.request({
- url: 'setting/tablelist',
- data: {
- store_id
- }
- }).then(res => {
- if (res.code == 200) {
- this.tableList = res.data;
- }
- })
- },
- }
- }
- </script>
- <style>
- @import url("../css/style.css");
- .tip {
- color: red;
- font-size: 24rpx;
- }
- .itemTextarea {
- /* border: 1rpx solid #F1F1F1; */
- }
- .itemTextarea textarea {
- width: 100%;
- }
- .homeForm {
- padding: 20rpx;
- padding-bottom: 40rpx;
- }
- .border {
- padding: 10rpx;
- border-bottom: 1rpx solid #F1F1F1;
- text-align: right;
- }
- .submit {
- background-color: #07c160;
- color: #FFFFFF;
- width: 630rpx;
- margin: 0 auto;
- height: 98rpx;
- margin-top: 30rpx;
- }
- .Transfer {
- position: absolute;
- bottom: 100rpx;
- width: 100%;
- text-align: center;
- font-size: 28rpx;
- color: #007AFF;
- }
- .Transfer navigator {
- display: inline-block;
- }
- .hide-input {
- position: fixed;
- left: 1000px;
- top: -1000px;
- width: 0;
- height: 0;
- }
- </style>
|