xcx.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="content">
  3. <view class="hg100"></view>
  4. <navigator class="item flex-center" url="../enabling/enabling">
  5. {{save_url?save_url:`请选择${$test.$test}内容`}}
  6. </navigator>
  7. <view class="hg300"></view>
  8. <button @click="submit" class="login-btn flex-center">保存</button>
  9. <view class="tip">温馨提示:小程序{{$test.$test}}仅限于平台提供的小程序使用,如有疑问请联系客服。</view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. $test: this.$test.$test,
  17. save_url: "",
  18. id: "",
  19. }
  20. },
  21. onLoad() {
  22. this.set_isxcx();
  23. },
  24. methods: {
  25. set_isxcx() {
  26. this.request({
  27. url: "user/set_isxcx",
  28. data: {
  29. token: uni.getStorageSync("token"),
  30. },
  31. }).then(res => {
  32. console.log(res, "res")
  33. if (res.code === '200') {
  34. this.save_url = res.data.qrurl;
  35. }
  36. });
  37. },
  38. submit(e) {
  39. this.request({
  40. url: "user/save_isxcx",
  41. data: {
  42. token: uni.getStorageSync("token"),
  43. id: this.id
  44. },
  45. }).then(res => {
  46. console.log(res, "user/gzhurl");
  47. if (res.code == 200) {
  48. uni.showToast({
  49. title: "保存成功",
  50. icon: 'none'
  51. })
  52. setTimeout((res) => {
  53. uni.navigateBack({
  54. delta: 1
  55. })
  56. }, 2000)
  57. }
  58. }).catch((res) => {
  59. console.log("message", res)
  60. uni.showToast({
  61. title: res.message,
  62. icon: 'none'
  63. })
  64. });
  65. }
  66. },
  67. }
  68. </script>
  69. <style>
  70. .tip {
  71. text-align: center;
  72. font-size: 28rpx;
  73. color: #999999;
  74. }
  75. .hg100 {
  76. height: 200rpx;
  77. }
  78. .hg300 {
  79. height: 300rpx;
  80. }
  81. .item {
  82. width: 600rpx;
  83. margin: 0 auto;
  84. background: #FFFFFF;
  85. box-shadow: 0px 0px 10rpx rgba(168, 168, 168, 0.16);
  86. opacity: 1;
  87. border-radius: 4rpx;
  88. min-height: 100rpx;
  89. padding: 20rpx;
  90. word-wrap: break-word;
  91. word-break: break-all;
  92. }
  93. .login-btn {
  94. width: 630rpx;
  95. height: 90rpx;
  96. background: linear-gradient(132deg, rgb(64, 158, 255) 0%, rgb(64, 158, 255) 100%);
  97. box-shadow: 0px 2rpx 12rpx rgb(64, 158, 255);
  98. opacity: 1;
  99. border-radius: 45rpx;
  100. margin: 0 auto;
  101. color: #FFFFFF;
  102. font-size: 30rpx;
  103. font-family: Source Han Sans CN;
  104. font-weight: 500;
  105. opacity: 1;
  106. }
  107. .tip {
  108. text-align: center;
  109. font-size: 26rpx;
  110. color: #999999;
  111. padding: 50rpx 0;
  112. width: 600rpx;
  113. margin: 0 auto;
  114. }
  115. </style>