addVersion.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <view class="page">
  3. <view class="step">
  4. <uni-steps active-color="#3387FF" :options="[{title: '扫码授权',url:'./qrCode'}, {title: '小程序配置',url:'./deploy'},
  5. {title: '提交版本',url:'./addVersion'},
  6. {title: '提交审核',url:'./addExamine'},{title: '版本管理',url:'./Versioning'} ]" :active="2"></uni-steps>
  7. </view>
  8. <view style="height: 130rpx;"></view>
  9. <view class="home">
  10. <form @submit="addVersion">
  11. <view class="homeForm ft28">
  12. <picker mode="selector" :range="tableTypeList" range-key="title" @change="onTableTypeChange">
  13. <view class="item flex-y-center box-pack-between">
  14. <text>门店id(仅限审核使用)</text>
  15. <view>
  16. <text>{{tableTypeActive}}</text>
  17. <text class="iconfont icongengduo" style="font-size: 26rpx;"></text>
  18. </view>
  19. </view>
  20. </picker>
  21. <picker mode="selector" :range="tableList" range-key="id" @change="onTableChange">
  22. <view class="item flex-y-center box-pack-between">
  23. <text>位置id(仅限审核使用): </text>
  24. <view>
  25. <text>{{table_id}}</text>
  26. <text class="iconfont icongengduo" style="font-size: 26rpx;"></text>
  27. </view>
  28. <input type="text" :value="table_id" name="table_id" placeholder="请输入餐桌id"
  29. class="hide-input" />
  30. </view>
  31. </picker>
  32. <view class="item flex-y-center box-pack-between">
  33. <text>版本号:</text>
  34. <view class="border">
  35. <input type="text" :value="obj.user_version" name="user_version" placeholder="请输入版本号" />
  36. </view>
  37. </view>
  38. <view class="tip">
  39. Tip:进入门店列表(对应审核门店id)>进入位置管理>即可找到位置ID。提交的版本号需大于当前版本号。
  40. </view>
  41. <button hover-class="none" form-type="submit" class="flex-grow-1 flex-center submit ft28">
  42. 提交版本
  43. </button>
  44. </view>
  45. </form>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. tableTypeList: [],
  54. tableTypeActive: "请选择",
  55. table_id: '',
  56. store_id: '',
  57. obj: {},
  58. tableList: []
  59. }
  60. },
  61. onLoad() {
  62. this.MiniVersion();
  63. },
  64. methods: {
  65. addVersion(e) {
  66. let {
  67. table_id,
  68. user_version
  69. } = e.detail.value;
  70. this.request({
  71. url: 'setting/uploadMiniVersion',
  72. data: {
  73. admin_id: uni.getStorageSync("admin_id"),
  74. store_id: this.store_id,
  75. table_id,
  76. user_version,
  77. }
  78. }).then(res => {
  79. if (res.code == '200') {
  80. console.log(res, "showModal")
  81. uni.showModal({
  82. title: '提示',
  83. content: res.message,
  84. showCancel: true,
  85. cancelText: '关闭',
  86. confirmText: '提交审核',
  87. success: r => {
  88. if (r.confirm) {
  89. uni.redirectTo({
  90. url: "./addExamine"
  91. })
  92. } else {
  93. uni.navigateBack({
  94. delta: 1
  95. })
  96. }
  97. },
  98. fail: () => {},
  99. complete: () => {}
  100. });
  101. }
  102. })
  103. },
  104. onTableTypeChange(e) {
  105. let store_id = this.tableTypeList[e.detail.value].id
  106. if (store_id != this.store_id) {
  107. this.tableTypeActive = this.tableTypeList[e.detail.value].title;
  108. this.store_id = store_id
  109. this.table_id = ""
  110. this.getTableList(this.store_id)
  111. }
  112. },
  113. onTableChange(e) {
  114. let table_id = this.tableList[e.detail.value].id
  115. this.table_id = table_id
  116. },
  117. // 版本列表
  118. MiniVersion(e) {
  119. this.request({
  120. url: 'setting/MiniVersion',
  121. data: {
  122. admin_id: uni.getStorageSync("admin_id"),
  123. }
  124. }).then(res => {
  125. if (res.code == 200) {
  126. this.obj = res.data;
  127. this.shop_store_index();
  128. }
  129. })
  130. },
  131. shop_store_index() {
  132. this.request({
  133. url: 'Smdcshop/shop_store_index',
  134. data: {
  135. admin_id: uni.getStorageSync("admin_id"),
  136. }
  137. }).then(res => {
  138. if (res.code == 200) {
  139. this.tableTypeList = res.data;
  140. if (this.obj.store_id) {
  141. let info = res.data.find((item) => item.id == this.obj.store_id)
  142. this.tableTypeActive = info.title;
  143. this.store_id = info.id;
  144. } else {
  145. this.tableTypeActive = res.data[0].title;
  146. this.store_id = res.data[0].id;
  147. }
  148. if (this.obj.table_id) {
  149. this.table_id = this.obj.table_id
  150. }
  151. this.getTableList(this.store_id)
  152. }
  153. })
  154. },
  155. getTableList(store_id) {
  156. this.request({
  157. url: 'setting/tablelist',
  158. data: {
  159. store_id
  160. }
  161. }).then(res => {
  162. if (res.code == 200) {
  163. this.tableList = res.data;
  164. }
  165. })
  166. },
  167. }
  168. }
  169. </script>
  170. <style>
  171. @import url("../css/style.css");
  172. .tip {
  173. color: red;
  174. font-size: 24rpx;
  175. }
  176. .homeForm {
  177. padding: 20rpx;
  178. padding-bottom: 40rpx;
  179. }
  180. .border {
  181. padding: 10rpx;
  182. border-bottom: 1rpx solid #F1F1F1;
  183. text-align: right;
  184. }
  185. .submit {
  186. background-color: #007AFF;
  187. color: #FFFFFF;
  188. width: 630rpx;
  189. margin: 0 auto;
  190. height: 98rpx;
  191. margin-top: 30rpx;
  192. }
  193. .Transfer {
  194. position: absolute;
  195. bottom: 100rpx;
  196. width: 100%;
  197. text-align: center;
  198. font-size: 28rpx;
  199. color: #007AFF;
  200. }
  201. .Transfer navigator {
  202. display: inline-block;
  203. }
  204. .hide-input {
  205. position: fixed;
  206. left: 1000px;
  207. top: -1000px;
  208. width: 0;
  209. height: 0;
  210. }
  211. </style>