deploy.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <view>
  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="1"></uni-steps>
  7. </view>
  8. <view style="height: 130rpx;"></view>
  9. <view class="home">
  10. <view class="box-pack-between item flex-y-center border-b">
  11. <text>小程序APPID</text>
  12. <view @click="copy(appid)">{{appid||''}} <text class="ft26" style="color:#3387FF;margin-left: 20rpx;">复制</text></view>
  13. </view>
  14. <view class="box-pack-between item flex-y-center">
  15. <text>体验版成员</text>
  16. <button class="deploy-add flex-center" hover="true" hover-class="detail-hover" @click="open">新增</button>
  17. </view>
  18. <view class="deploy-list" v-if="deplist.length>0">
  19. <view class="item-bg" >
  20. <view class="box-pack-between mar64 flex-y-center" v-for="(item,index) of deplist" :key='index'>
  21. <view class="flex-y-center flex-grow-1 pdr-20">
  22. <view class="deploy-list-nick text-1">
  23. {{item.nick_name}}
  24. </view>
  25. <view class="deploy-list-logon text-1">
  26. {{item.logon_id}}
  27. </view>
  28. {{item.status}}
  29. </view>
  30. <view class="iconfont iconshanjian item-del" @click="del(index)"></view>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="home">
  36. <view class="box-pack-between item flex-y-center pd20">
  37. <text>二维码规则配置</text>
  38. <view class="flex">
  39. <!-- <button class="deploy-add flex-center" hover="true" hover-class="detail-hover"
  40. @click="ConfigRule">配置规则</button> -->
  41. <button class="deploy-add flex-center" hover="true" hover-class="detail-hover"
  42. @click="AppendRule">配置规则</button>
  43. </view>
  44. </view>
  45. <view class="flex-y-center box-pack-between ft28 border-b pd2-3" v-for="(item,index) of linkArr"
  46. :key='index'>
  47. <view class="word">
  48. <view class="qr_link">
  49. 地址:{{item.https}}
  50. </view>
  51. <view class="qr_link">
  52. 路径:{{item.pages}}
  53. </view>
  54. </view>
  55. <view class="iconfont iconshanjian item-del" @click="DelRule(index)"></view>
  56. </view>
  57. </view>
  58. <!-- 纵向排列 -->
  59. <uni-popup ref="popup" type="center">
  60. <view class="model">
  61. <form @submit="addDeploy">
  62. <view class="model-refund-title ft28">
  63. 请输入支付宝账号(体验者账号)
  64. </view>
  65. <view style="padding: 20rpx;">
  66. <view class="amount-input">
  67. <input type="text" name="logon_id" placeholder="请输入支付宝账号" />
  68. </view>
  69. </view>
  70. <view class="flex-y-center model-refund-btn">
  71. <view class="flex-grow-1 flex-center cancel" @click="cancel">
  72. 取消
  73. </view>
  74. <button hover-class="none" form-type="submit" class="flex-grow-1 flex-center submit ft28">
  75. 添加
  76. </button>
  77. </view>
  78. </form>
  79. </view>
  80. </uni-popup>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. data() {
  86. return {
  87. appid: "",
  88. deplist: [],
  89. linkArr: [],
  90. }
  91. },
  92. onLoad() {
  93. this.getAppid();
  94. this.alipay_MiniUserlist();
  95. this.ewmguizhe();
  96. },
  97. methods: {
  98. open() {
  99. this.$refs.popup.open();
  100. },
  101. cancel() {
  102. this.$refs.popup.close();
  103. },
  104. copy(appid) {
  105. // #ifdef MP-WEIXIN
  106. uni.setClipboardData({
  107. data:appid,
  108. success: function() {
  109. console.log('success');
  110. }
  111. });
  112. // #endif
  113. // #ifdef H5
  114. let content = appid;
  115. if (!document.queryCommandSupported('copy')) {
  116. // 不支持
  117. return false
  118. }
  119. let textarea = document.createElement("input")
  120. textarea.value = content
  121. textarea.readOnly = "readOnly"
  122. document.body.appendChild(textarea)
  123. textarea.select() // 选择对象
  124. textarea.setSelectionRange(0, content.length) //核心
  125. let result = document.execCommand("copy") // 执行浏览器复制命令
  126. textarea.remove();
  127. uni.showToast({
  128. title: "复制成功",
  129. icon: 'none'
  130. })
  131. return result
  132. // #endif
  133. },
  134. // 删除支付宝体验者
  135. del(index) {
  136. uni.showModal({
  137. title: '提示',
  138. content: '确定要删除用户吗?',
  139. showCancel: true,
  140. cancelText: '取消',
  141. confirmText: '确定',
  142. success: res => {
  143. if (res.confirm) {
  144. this.request({
  145. url: 'setting/delMiniUser',
  146. data: {
  147. admin_id: uni.getStorageSync("admin_id"),
  148. user_id: this.deplist[index].user_id,
  149. }
  150. }).then(res => {
  151. uni.showToast({
  152. title: res.message,
  153. icon: 'none'
  154. })
  155. this.deplist.splice(index, 1);
  156. })
  157. }
  158. },
  159. fail: () => {},
  160. complete: () => {}
  161. });
  162. },
  163. // 新增规则
  164. ConfigRule(e) {
  165. this.request({
  166. url: 'setting/oldaddqrcode',
  167. data: {
  168. admin_id: uni.getStorageSync("admin_id"),
  169. }
  170. }).then(res => {
  171. if (res.code == 200) {
  172. uni.showToast({
  173. title: res.message,
  174. icon: 'none'
  175. })
  176. setTimeout(()=>{
  177. this.ewmguizhe();
  178. },2000)
  179. }
  180. })
  181. },
  182. // 追加规则
  183. AppendRule(e) {
  184. this.request({
  185. url: 'setting/addqrcode',
  186. data: {
  187. admin_id: uni.getStorageSync("admin_id"),
  188. }
  189. }).then(res => {
  190. if (res.code == 200) {
  191. uni.showToast({
  192. title: res.message,
  193. icon: 'none'
  194. })
  195. setTimeout(()=>{
  196. this.ewmguizhe();
  197. },2000)
  198. }
  199. })
  200. },
  201. // 删除规则
  202. DelRule(index) {
  203. uni.showModal({
  204. title: '提示',
  205. content: '确定要删除规则吗?',
  206. showCancel: true,
  207. cancelText: '取消',
  208. confirmText: '确定',
  209. success: res => {
  210. if (res.confirm) {
  211. this.request({
  212. url: 'setting/delewmgz',
  213. data: {
  214. admin_id: uni.getStorageSync("admin_id"),
  215. id: this.linkArr[index].id,
  216. }
  217. }).then(res => {
  218. uni.showToast({
  219. title: res.message,
  220. icon: 'none'
  221. })
  222. this.linkArr.splice(index, 1);
  223. })
  224. }
  225. },
  226. fail: () => {},
  227. complete: () => {}
  228. });
  229. },
  230. // 规则列表
  231. ewmguizhe(e) {
  232. this.request({
  233. url: 'setting/ewmguizhe',
  234. data: {
  235. admin_id: uni.getStorageSync("admin_id"),
  236. }
  237. }).then(res => {
  238. if (res.code == 200) {
  239. this.linkArr = res.data;
  240. }
  241. })
  242. },
  243. // 添加支付宝体验者
  244. addDeploy(e) {
  245. let {
  246. logon_id
  247. } = e.detail.value;
  248. this.request({
  249. url: 'setting/addMiniUser',
  250. data: {
  251. admin_id: uni.getStorageSync("admin_id"),
  252. logon_id: logon_id,
  253. }
  254. }).then(res => {
  255. if (res.code == 200) {
  256. this.alipay_MiniUserlist();
  257. this.$refs.popup.close();
  258. }
  259. })
  260. },
  261. // 获取appid
  262. getAppid() {
  263. this.request({
  264. url: 'setting/alipay_Appid',
  265. data: {
  266. admin_id: uni.getStorageSync("admin_id"),
  267. }
  268. }).then(res => {
  269. if (res.code == 200) {
  270. this.appid = res.data.appid;
  271. }
  272. })
  273. },
  274. // 获取体验者
  275. alipay_MiniUserlist() {
  276. this.request({
  277. url: 'setting/alipay_MiniUserlist',
  278. data: {
  279. admin_id: uni.getStorageSync("admin_id"),
  280. }
  281. }).then(res => {
  282. if (res.code == 200) {
  283. this.deplist = res.data;
  284. }
  285. })
  286. },
  287. }
  288. }
  289. </script>
  290. <style>
  291. @import url("../css/style.css");
  292. page .detail-hover {
  293. opacity: 0.6;
  294. transform: scale(0.8, 0.8);
  295. /*缩放*/
  296. /* background-color: #999999; */
  297. /* color: #999999; */
  298. }
  299. .pd20 {
  300. padding: 20rpx;
  301. }
  302. .pd2-3 {
  303. padding: 20rpx 30rpx;
  304. }
  305. .step {
  306. padding: 20rpx 0;
  307. position: fixed;
  308. width: 100%;
  309. background: #FFFFFF;
  310. z-index: 999;
  311. }
  312. /* .home {
  313. background-color: #FFFFFF;
  314. margin-bottom: 20rpx;
  315. }
  316. .item {
  317. height: 100rpx;
  318. padding: 0 20rpx;
  319. } */
  320. .deploy-add {
  321. padding: 0 22rpx;
  322. height: 60rpx;
  323. text-align: center;
  324. border-radius: 10rpx;
  325. font-size: 28rpx;
  326. background-color: #007AFF;
  327. color: #FFFFFF;
  328. margin-left: 20rpx;
  329. }
  330. .deploy-list {
  331. padding: 24rpx;
  332. }
  333. .item-bg {
  334. background: #f6f8fe;
  335. border-radius: 12rpx;
  336. margin: 0 auto;
  337. font-size: 28rpx;
  338. font-family: PingFang SC, PingFang SC-Regular;
  339. font-weight: 400;
  340. color: #333333;
  341. padding: 36rpx 32rpx;
  342. }
  343. .item-del {
  344. color: red;
  345. }
  346. .item-bg-32 {
  347. margin-right: 32rpx;
  348. }
  349. .item-bg .mar64:last-child {
  350. margin-bottom: 0rpx;
  351. }
  352. .deploy-list-nick {
  353. width: 150rpx;
  354. margin-right: 20rpx;
  355. }
  356. .deploy-list-logon {
  357. width: 180rpx;
  358. margin-right: 30rpx;
  359. }
  360. .mar64 {
  361. margin-bottom: 64rpx;
  362. }
  363. .amount-input {
  364. padding: 20rpx;
  365. border: 1rpx solid #F1F1F1;
  366. }
  367. .model {
  368. background: #FFFFFF;
  369. border-radius: 10rpx;
  370. width: 600rpx;
  371. overflow: hidden;
  372. }
  373. .model-refund-title {
  374. text-align: center;
  375. padding: 20rpx 0;
  376. }
  377. .model-refund-btn {
  378. border-top-color: #f5f5f5;
  379. border-top-style: solid;
  380. border-top-width: 1px;
  381. }
  382. .model-refund-btn .cancel {
  383. height: 90rpx;
  384. }
  385. .model-refund-btn .submit {
  386. height: 90rpx;
  387. border-left: 1rpx solid #f1f1f1;
  388. border-radius: 0;
  389. }
  390. button {
  391. background-color: #fff;
  392. padding: 0;
  393. margin: 0;
  394. line-height: 1rpx;
  395. /* border: 1px solid #cccccc; */
  396. min-height: 0;
  397. font-size: 28rpx;
  398. background: #fff;
  399. border-radius: none;
  400. }
  401. button::after {
  402. border: none;
  403. }
  404. .qr_link {
  405. margin-bottom: 10rpx;
  406. }
  407. </style>