cooperation.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <template>
  2. <view>
  3. <image class="bgimg"
  4. src="/static/image/high_zmjh.png"
  5. mode="widthFix"></image>
  6. <view class="info">
  7. <view class="info-box">
  8. <view class="info-box-title">
  9. 代理商申请
  10. </view>
  11. <view class="info-box-item">
  12. <view class="info-box-item-name">联系人姓名</view>
  13. <u-input placeholder="请输入联系人姓名" v-model="applyName" :clearable="false"></u-input>
  14. </view>
  15. <view class="line"></view>
  16. <view class="info-box-item">
  17. <view class="info-box-item-name">联系人手机号</view>
  18. <u-input placeholder="请输入联系人手机号" v-model="applyPhone" :clearable="false"></u-input>
  19. </view>
  20. <view class="line"></view>
  21. <view class="info-box-item">
  22. <view class="info-box-item-name">地址</view>
  23. <u-input placeholder="请选择所在区域地址" v-model=" applyContent" @click="getcity()" :disabled="true"
  24. :clearable="false">
  25. </u-input>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="sub">
  30. <view class="sub-box">
  31. <view class="sub-box-l" @click="submit()" v-if="!applyId">确认提交</view>
  32. <view class="sub-box-r" @click="goChat()" v-if="!applyId">直接联系 </view>
  33. <view class="sub-box-rs" @click="goChat()" v-else>直接联系 </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. applyName: '',
  43. applyPhone: '',
  44. applyContent: '',
  45. applyId: ''
  46. };
  47. },
  48. onLoad() {
  49. this.getDetail()
  50. },
  51. onShow() {
  52. },
  53. methods: {
  54. getDetail() {
  55. let data = {
  56. classify: 1
  57. }
  58. this.$Request.get("/app/apply/selectApplyByUserIdAndClassify", data).then(res => {
  59. if (res.code == 0 && res.data) {
  60. this.applyName = res.data.applyName
  61. this.applyPhone = res.data.applyPhone
  62. this.applyContent = res.data.applyContent
  63. this.applyId = res.data.status
  64. }
  65. })
  66. },
  67. getcity() {
  68. // console.log(55555)
  69. let that = this
  70. uni.chooseLocation({
  71. success: function(res) {
  72. console.log('位置名称:' + res.name);
  73. console.log('详细地址:' + res.address);
  74. console.log('纬度:' + res.latitude);
  75. console.log('经度:' + res.longitude);
  76. that.applyContent = res.address + res.name
  77. }
  78. });
  79. },
  80. goChat() {
  81. let kefu = this.$queue.getData('kefu'); // 用户端联系方式 1 手机号 2企业微信
  82. let kefuPhone = this.$queue.getData('kefuPhone');
  83. if (kefu == 1) {
  84. uni.makePhoneCall({
  85. phoneNumber: kefuPhone //仅为示例
  86. });
  87. } else if (kefu == 3) {
  88. uni.navigateTo({
  89. url: '/my/setting/customer'
  90. });
  91. } else {
  92. // #ifdef MP-WEIXIN
  93. let that = this
  94. try {
  95. wx.openCustomerServiceChat({
  96. extInfo: {
  97. url: that.$queue.getData('kefuUrl')
  98. },
  99. corpId: that.$queue.getData('kefuAppId'),
  100. success(res) {},
  101. fail(res) {
  102. console.error(res)
  103. }
  104. })
  105. } catch (error) {
  106. console.error("catchcatch" + error)
  107. uni.showToast({
  108. title: '请更新至微信最新版本'
  109. });
  110. }
  111. // #endif
  112. // #ifndef MP-WEIXIN
  113. let url = this.$queue.getData('kefuUrl');
  114. if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
  115. uni.navigateTo({
  116. url
  117. });
  118. } else {
  119. //#ifndef H5
  120. uni.navigateTo({
  121. url: '/pages/index/webView?url=' + url
  122. });
  123. //#endif
  124. //#ifdef H5
  125. window.location.href = url;
  126. //#endif
  127. }
  128. // #endif
  129. }
  130. },
  131. submit() {
  132. if (!this.applyName) {
  133. uni.showToast({
  134. title: '请输入联系人姓名',
  135. icon: 'none'
  136. })
  137. return
  138. }
  139. if (!this.applyPhone) {
  140. uni.showToast({
  141. title: '请输入联系人手机号码',
  142. icon: 'none'
  143. })
  144. return
  145. }
  146. if (!this.applyContent) {
  147. uni.showToast({
  148. title: '请输入地址',
  149. icon: 'none'
  150. })
  151. return
  152. }
  153. let data = {
  154. applyName: this.applyName,
  155. applyPhone: this.applyPhone,
  156. applyContent: this.applyContent,
  157. classify: 1
  158. }
  159. this.$Request.postJson("/app/apply/insertApply", data).then(res => {
  160. if (res.code == 0) {
  161. uni.showToast({
  162. title: '提交成功!',
  163. icon: 'none'
  164. })
  165. setTimeout(function() {
  166. uni.navigateBack()
  167. }, 1000)
  168. } else {
  169. uni.showToast({
  170. title: res.msg,
  171. icon: 'none'
  172. })
  173. }
  174. })
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="less">
  180. page {
  181. background-color: #f5f5f5;
  182. }
  183. .bgimg {
  184. position: relative;
  185. width: 100%;
  186. }
  187. .info {
  188. // width: 90%;
  189. height: auto;
  190. display: flex;
  191. justify-content: center;
  192. position: absolute;
  193. top: 750rpx;
  194. background-image: url('/static/image/card_dali.png');
  195. background-size: 100% 100%;
  196. margin: 30upx;
  197. padding: 30upx;
  198. .info-box {
  199. width: 620rpx;
  200. .info-box-title {
  201. color: #333333;
  202. font-size: 32rpx;
  203. font-weight: 800;
  204. text-align: center;
  205. }
  206. .info-box-item {
  207. margin-top: 30rpx;
  208. .info-box-item-name {
  209. font-size: 28rpx;
  210. color: #333333;
  211. font-weight: 800;
  212. margin-bottom: 10rpx;
  213. }
  214. }
  215. .line {
  216. width: 100%;
  217. border: 1rpx solid #B4BCFF;
  218. margin-top: 20rpx;
  219. }
  220. }
  221. }
  222. .sub {
  223. width: 100%;
  224. height: 88rpx;
  225. display: flex;
  226. justify-content: center;
  227. position: absolute;
  228. top: 1430rpx;
  229. .sub-box {
  230. width: 613rpx;
  231. height: 100%;
  232. display: flex;
  233. justify-content: space-between;
  234. .sub-box-l {
  235. width: 290rpx;
  236. height: 88rpx;
  237. background: #97A8F8;
  238. border-radius: 44rpx;
  239. color: #ffffff;
  240. font-size: 28rpx;
  241. font-weight: bold;
  242. display: flex;
  243. justify-content: center;
  244. align-items: center;
  245. }
  246. .sub-box-rs {
  247. width: 600rpx;
  248. height: 88rpx;
  249. background: #435DF0;
  250. border-radius: 44rpx;
  251. color: #ffffff;
  252. font-size: 28rpx;
  253. font-weight: bold;
  254. display: flex;
  255. justify-content: center;
  256. align-items: center;
  257. }
  258. .sub-box-r {
  259. width: 290rpx;
  260. height: 88rpx;
  261. background: #435DF0;
  262. border-radius: 44rpx;
  263. color: #ffffff;
  264. font-size: 28rpx;
  265. font-weight: bold;
  266. display: flex;
  267. justify-content: center;
  268. align-items: center;
  269. }
  270. }
  271. }
  272. </style>