extension.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <template>
  2. <view>
  3. <image class="bgimg" src="https://pt2.0.xianmxkj.com/file/uploadPath/2022/11/09/8030d98585b4864140a4c1da8d6fa306.png" mode="widthFix"></image>
  4. <view class="info">
  5. <view class="info-box">
  6. <view class="info-box-title">
  7. 推广申请信息
  8. </view>
  9. <view class="info-box-item">
  10. <view class="info-box-item-name">联系人姓名</view>
  11. <u-input placeholder="请输入联系人姓名" v-model="applyName" :clearable="false"></u-input>
  12. </view>
  13. <view class="line"></view>
  14. <view class="info-box-item">
  15. <view class="info-box-item-name">联系人手机号</view>
  16. <u-input placeholder="请输入联系人手机号" v-model="applyPhone" :clearable="false"></u-input>
  17. </view>
  18. <view class="line"></view>
  19. <view class="info-box-item">
  20. <view class="info-box-item-name">地址</view>
  21. <u-input placeholder="请选择所在区域地址" v-model=" applyContent" @click="getcity()" :disabled="true"
  22. :clearable="false">
  23. </u-input>
  24. </view>
  25. <view class="" v-if="remarks && type!=2 && type!=1" style="color: red;">
  26. 拒绝原因:{{remarks}}
  27. </view>
  28. <!-- <view class="sub-box-l" @click="submit()" v-if="applyId!=1">确认提交</view> -->
  29. <view class="sub-box-l" @click="submit()" v-if="type!=2 && type!=1">确认提交</view>
  30. </view>
  31. </view>
  32. <!-- <view class="sub">
  33. <view class="sub-box">
  34. <view class="sub-box-l" @click="submit()">确认提交</view>
  35. <view class="sub-box-r" @click="Changekefu()">直接联系 </view>
  36. </view>
  37. </view> -->
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. applyName: '',
  45. applyPhone: '',
  46. applyContent: '',
  47. applyId:'',
  48. type:'',//1:首次提交 2:已通过 3:已拒绝
  49. remarks:'',
  50. };
  51. },
  52. onLoad() {
  53. this.getDetail()
  54. },
  55. onShow() {
  56. },
  57. methods: {
  58. getcity() {
  59. // console.log(55555)
  60. let that = this
  61. uni.chooseLocation({
  62. success: function(res) {
  63. console.log('位置名称:' + res.name);
  64. console.log('详细地址:' + res.address);
  65. console.log('纬度:' + res.latitude);
  66. console.log('经度:' + res.longitude);
  67. that.applyContent = res.address + res.name
  68. }
  69. });
  70. },
  71. Changekefu() {
  72. let that = this
  73. // #ifdef MP-WEIXIN
  74. wx.openCustomerServiceChat({
  75. extInfo: {
  76. url: that.$queue.getData('kefu')
  77. },
  78. corpId: that.$queue.getData('kefuAppId'),
  79. success(res) {}
  80. })
  81. // #endif
  82. // #ifdef H5
  83. window.location.href = that.$queue.getData('kefu');
  84. // #endif
  85. // #ifdef APP
  86. let kefu = that.$queue.getData('kefu')
  87. console.log(kefu)
  88. plus.runtime.openURL(kefu, function(res) {});
  89. // #endif
  90. },
  91. getDetail() {
  92. this.$Request.getT("/app/userExtension/getUserExtensionInfo").then(res => {
  93. if (res.code == 0&&res.data) {
  94. this.applyName=res.data.realName
  95. this.applyPhone=res.data.phone
  96. this.applyContent=res.data.addressDetail
  97. this.applyId = res.data.extensionId
  98. this.type=res.data.status
  99. this.remarks = res.data.remarks
  100. }else{
  101. this.type=''
  102. }
  103. })
  104. },
  105. submit() {
  106. if (!this.applyName) {
  107. uni.showToast({
  108. title: '请输入联系人姓名',
  109. icon: 'none'
  110. })
  111. return
  112. }
  113. if (!this.applyPhone) {
  114. uni.showToast({
  115. title: '请输入联系人手机号码',
  116. icon: 'none'
  117. })
  118. return
  119. }
  120. if (!this.applyContent) {
  121. uni.showToast({
  122. title: '请输入地址',
  123. icon: 'none'
  124. })
  125. return
  126. }
  127. let data = {
  128. realName: this.applyName,
  129. phone: this.applyPhone,
  130. addressDetail: this.applyContent,
  131. }
  132. if(this.applyId){
  133. data.extensionId = this.applyId
  134. }
  135. if(this.type==''){
  136. this.$Request.postT("/app/userExtension/addUserExtension", data).then(res => {
  137. if (res.code == 0) {
  138. uni.showToast({
  139. title: '提交成功!',
  140. icon: 'none'
  141. })
  142. setTimeout(function() {
  143. uni.navigateBack()
  144. }, 1000)
  145. }
  146. })
  147. }else if(this.type==3){
  148. this.$Request.postT("/app/userExtension/updateUserExtension", data).then(res => {
  149. if (res.code == 0) {
  150. uni.showToast({
  151. title: '修改成功!',
  152. icon: 'none'
  153. })
  154. setTimeout(function() {
  155. uni.navigateBack()
  156. }, 1000)
  157. }
  158. })
  159. }
  160. }
  161. }
  162. }
  163. </script>
  164. <style lang="less">
  165. page {
  166. background-color: #f5f5f5;
  167. }
  168. .bgimg {
  169. position: relative;
  170. width: 100%;
  171. }
  172. .info {
  173. width: 680upx;
  174. height: auto;
  175. display: flex;
  176. justify-content: center;
  177. position: absolute;
  178. top: 700rpx;
  179. // background-image: url('../static/zsbg.png');
  180. background: linear-gradient(0deg, #3A88FF 0%, #B7E1FF 100%);
  181. border-radius: 32upx;
  182. background-size: 100% 100%;
  183. margin: 30upx;
  184. padding: 30upx;
  185. .info-box {
  186. width: 620rpx;
  187. background: #ffffff;
  188. border-radius: 32upx;
  189. padding: 30upx;
  190. .info-box-title {
  191. color: #333333;
  192. font-size: 32rpx;
  193. font-weight: 800;
  194. text-align: center;
  195. }
  196. .info-box-item {
  197. margin-top: 30rpx;
  198. .info-box-item-name {
  199. font-size: 28rpx;
  200. color: #333333;
  201. font-weight: 800;
  202. margin-bottom: 10rpx;
  203. }
  204. }
  205. .line {
  206. width: 100%;
  207. border: 1rpx solid #EAEAEA;
  208. margin-top: 20rpx;
  209. }
  210. }
  211. }
  212. .sub-box-l {
  213. // width: 290rpx;
  214. height: 88rpx;
  215. background: #435DF0;
  216. border-radius: 44rpx;
  217. color: #ffffff;
  218. font-size: 28rpx;
  219. font-weight: bold;
  220. display: flex;
  221. justify-content: center;
  222. align-items: center;
  223. margin-top: 60upx;
  224. }
  225. .sub {
  226. width: 100%;
  227. height: 88rpx;
  228. display: flex;
  229. justify-content: center;
  230. position: absolute;
  231. top: 1430rpx;
  232. .sub-box {
  233. width: 613rpx;
  234. height: 100%;
  235. display: flex;
  236. justify-content: space-between;
  237. .sub-box-l {
  238. width: 290rpx;
  239. height: 88rpx;
  240. background: #97A8F8;
  241. border-radius: 44rpx;
  242. color: #ffffff;
  243. font-size: 28rpx;
  244. font-weight: bold;
  245. display: flex;
  246. justify-content: center;
  247. align-items: center;
  248. }
  249. .sub-box-r {
  250. width: 290rpx;
  251. height: 88rpx;
  252. background: #435DF0;
  253. border-radius: 44rpx;
  254. color: #ffffff;
  255. font-size: 28rpx;
  256. font-weight: bold;
  257. display: flex;
  258. justify-content: center;
  259. align-items: center;
  260. }
  261. }
  262. }
  263. </style>