editOutbound.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view class="container outbound-content">
  3. <!-- 这里顶部安全是状态栏 -->
  4. <view class="status_bar" color="#000000" :style="'height:'+ demoTop+ 'px;'"> </view>
  5. <!-- 自定义状态栏 -->
  6. <view class="status_title">
  7. <u-icon name="arrow-left" size="38" @click="backArrowleft"></u-icon>
  8. <view class="status_center">{{isShowTitle}}</view>
  9. </view>
  10. <!-- 文本提示 -->
  11. <view class="top-box" v-if="isShowTitle=='修改外呼号码' ||identification=='邮箱'">
  12. 修改后的外呼号码,将作为您的默认外呼号码,若后期还需修改,可在【我的】-【外呼号码】页面设置
  13. </view>
  14. <!-- 输入外呼手机号 -->
  15. <view class="item-box">
  16. <view class="ipt-item">
  17. <label class="item-label item-iphone" @click="areaCode">+{{telephone}} <u-icon :name="areacodeShow?'arrow-up':'arrow-down'" color="#3385FF" size="28"></u-icon></label>
  18. <input type="text" v-model="phoneIpt" class="ipt" placeholder="请输入外呼号码">
  19. </view>
  20. <text class="text-box">座机号请填写区号,分机号用"-"分隔,例:02150509999-8888</text>
  21. </view>
  22. <!-- 底部确认 和取消 -->
  23. <view class="bottom-btn">
  24. <view class="submit-box" @click="submit">
  25. 提交
  26. </view>
  27. <view class="cancel" v-if="isShowTitle!=='设置外呼号码'" @click="cancelModification">
  28. 取消修改
  29. </view>
  30. </view>
  31. <!-- 选择区号部分 -->
  32. <view class="select-box">
  33. <u-popup v-model="areacodeShow" mode="bottom" @close="areacodeShow=false">
  34. <view class="box" style="color: #333333;font-size: 28rpxrpx;">请选择您的国际区号</view>
  35. <view class="box" style="color: #2C83FF;" @click="areacode('86')">大陆+86</view>
  36. <view class="box" style="color: #2C83FF;" @click="areacode('852')">香港+852</view>
  37. <view class="box" style="color: #2C83FF;" @click="areacode('886')">台湾+886</view>
  38. <view class="box" style="color: #2C83FF;" @click="areacode('1')">美国+1</view>
  39. <view class="box" style="color: #2C83FF;" @click="areacode('65')">新加坡+65</view>
  40. <view class="box box-bottom" style="color: #A9AFB8;" @click="areacodeShow=false">取消</view>
  41. </u-popup>
  42. </view>
  43. <!-- 关注公众号 弹框 -->
  44. <u-modal v-model="goFollowShow" :content-style="{fontSize: '32rpx'}" @confirm="goFollowShowBtn"
  45. :show-cancel-button="true" confirm-text="去关注" @cancel="cancelDialog" :show-title="false"
  46. :cancel-style="{borderRight:'1rpx solid #EBEBEB'}" :confirm-style="{fontWeight: '700'}">
  47. <view class="slot-content">
  48. <rich-text :nodes="accounts"></rich-text>
  49. </view>
  50. </u-modal>
  51. <!-- 知道的弹框 -->
  52. <u-modal v-model="show" :content="content" :content-style="{fontSize: '32rpx'}" @confirm="cancelDialog"
  53. :show-title="false" confirm-text="知道了" :confirm-style="{fontWeight: '700'}">
  54. <view class="slot-content">
  55. <rich-text :nodes="content"></rich-text>
  56. </view>
  57. </u-modal>
  58. </view>
  59. </template>
  60. <script>
  61. import {activity} from "@/config/api.js";
  62. export default {
  63. data() {
  64. return {
  65. phoneIpt:'',
  66. isShowTitle:'设置',
  67. telephone:'86',
  68. areacodeShow: false,
  69. identification:'',
  70. goFollowShow:false,
  71. accounts:'',
  72. show:false,
  73. content:'',
  74. demoTop:'',
  75. id:'',
  76. goOnNextStep:'',
  77. cellphone:''
  78. }
  79. },
  80. methods: {
  81. areaCode(){
  82. this.areacodeShow= true
  83. },
  84. areacode(code){
  85. this.telephone=code
  86. this.areacodeShow= false
  87. },
  88. //提交
  89. submit(){
  90. activity.addOutboundMobile({
  91. ActivityId:Number(this.id),
  92. OutboundCountryCode:this.telephone,
  93. OutboundMobile:this.phoneIpt
  94. }).then(res=>{
  95. if(res.Ret !== 200 ) return
  96. if(this.identification=='修改'||this.identification=='邮箱'){
  97. if(this.identification=="邮箱"){
  98. let pages = getCurrentPages()
  99. let prevPage = pages[pages.length - 2]
  100. if(prevPage.$page.fullPath=='/pages/activity/activity'||prevPage.$page.fullPath=='/activityPages/activitySearch/activitySearch'){
  101. const index = prevPage.$vm.collectList.findIndex(item => item.ActivityId == this.id)
  102. prevPage.$vm.collectList[index].IsSignup = 1
  103. }
  104. }
  105. if(this.goOnNextStep=='true') {
  106. this.accounts=`
  107. ${this.telephone}-${this.phoneIpt}<br/>
  108. 预约成功,已加入您的活动日程<br/><br/>
  109. 想要及时获取活动时间变更通知,请关注【查研观向小助手】公众号
  110. `
  111. this.goFollowShow=true
  112. }else {
  113. this.content=`
  114. ${this.telephone}-${this.phoneIpt}<br/><br/>
  115. 预约外呼成功,已加入您的活动日程
  116. `
  117. this.show=true
  118. }
  119. }else {
  120. uni.navigateBack()
  121. }
  122. })
  123. },
  124. //取消修改
  125. cancelModification(){
  126. if(this.identification=='修改'){
  127. if(this.goOnNextStep=='true') {
  128. this.accounts=`
  129. ${this.cellphone}<br/>
  130. 预约成功,已加入您的活动日程<br/><br/>
  131. 想要及时获取活动时间变更通知,请关注【查研观向小助手】公众号
  132. `
  133. this.goFollowShow=true
  134. }else {
  135. this.content=`
  136. ${this.cellphone}<br/><br/>
  137. 预约外呼成功,已加入您的活动日程
  138. `
  139. this.show=true
  140. }
  141. }else {
  142. uni.navigateBack()
  143. }
  144. },
  145. //去关注公众号
  146. goFollowShowBtn(){
  147. uni.redirectTo({
  148. url: '/activityPages/accountsOfficial/accountsOfficial'
  149. })
  150. },
  151. //弹框的取消
  152. cancelDialog(){
  153. uni.navigateBack()
  154. },
  155. //右上角的返回
  156. backArrowleft(){
  157. if(this.identification=='修改'){
  158. if(this.goOnNextStep=='true') {
  159. this.accounts=`
  160. ${this.cellphone}<br/>
  161. 预约成功,已加入您的活动日程<br/><br/>
  162. 想要及时获取活动时间变更通知,请关注【查研观向小助手】公众号
  163. `
  164. this.goFollowShow=true
  165. }else {
  166. this.content=`
  167. ${this.cellphone}<br/><br/>
  168. 预约外呼成功,已加入您的活动日程
  169. `
  170. this.show=true
  171. }
  172. }else {
  173. uni.navigateBack()
  174. }
  175. },
  176. },
  177. onLoad(option) {
  178. this.isShowTitle=option.title
  179. this.identification=option.identification
  180. this.id= option.id || ''
  181. this.goOnNextStep=option.goOnNextStep||''
  182. this.cellphone=option.cellphone||''
  183. const res = uni.getSystemInfoSync()
  184. this.demoTop=res.safeArea.top
  185. },
  186. }
  187. </script>
  188. <style scoped lang="scss">
  189. .outbound-content {
  190. /* 自定义状态栏 */
  191. .status_bar {
  192. width: 100%;
  193. }
  194. /* 自定义导航栏 */
  195. .status_title {
  196. box-sizing: border-box;
  197. display: flex;
  198. align-items: center;
  199. width: 100%;
  200. height: 88rpx;
  201. padding: 10rpx 62rpx 15rpx 30rpx;
  202. background-color: #FFFFFF;
  203. box-sizing: border-box;
  204. }
  205. .status_center {
  206. margin: 0 auto;
  207. font-size: 34rpx;
  208. font-weight: 400;
  209. color: #000000;
  210. }
  211. .top-box {
  212. width: 100%;
  213. background-color: #F7F7F7;
  214. padding: 20rpx 34rpx ;
  215. font-size: 28rpx;
  216. font-weight: 400;
  217. line-height: 48rpx;
  218. color: #666666;
  219. }
  220. .item-box {
  221. width: 100%;
  222. margin-top: 35rpx;
  223. padding: 0 32rpx;
  224. .text-box {
  225. height: 30rpx;
  226. font-size: 22rpx;
  227. line-height: 30px;
  228. color: #999999;
  229. }
  230. }
  231. .ipt-item {
  232. padding: 33rpx 0 10rpx;
  233. border-bottom: 1rpx solid #D6D6D6;
  234. display: flex;
  235. align-items: center;
  236. font-size: 28rpx;
  237. .item-label {
  238. display: flex;
  239. justify-content: space-between;
  240. width: 105rpx;
  241. color: #3385FF;
  242. }
  243. .ipt {
  244. margin-left: 40rpx;
  245. width: 500rpx;
  246. font-size: 32rpx;
  247. color: #666;
  248. }
  249. }
  250. .bottom-btn {
  251. margin-top: 247rpx;
  252. font-size: 34rpx;
  253. text-align: center;
  254. .submit-box {
  255. margin: 0 auto;
  256. width: 368rpx;
  257. height: 80rpx;
  258. background: linear-gradient(268deg, #2DDBFF 0%, #1599FF 49%, #005EFF 100%);
  259. color: #FFFFFF;
  260. line-height: 80rpx;
  261. border-radius: 4rpx;
  262. }
  263. .cancel {
  264. margin: 30rpx auto;
  265. width: 368rpx;
  266. height: 80rpx;
  267. border: 2px solid #2C83FF;
  268. border-radius: 4rpx;
  269. line-height: 80rpx;
  270. color: #2C83FF;
  271. }
  272. }
  273. .select-box {
  274. width: 100%;
  275. .box {
  276. height: 95prx;
  277. line-height: 95rpx;
  278. text-align: center;
  279. font-size: 32rpx;
  280. border-bottom: 1rpx solid #EBEBEB;
  281. }
  282. .box-bottom {
  283. border-bottom: none !important;
  284. }
  285. }
  286. }
  287. .slot-content {
  288. width: 100%;
  289. padding: 50rpx;
  290. text-align: center;
  291. font-size: 32rpx;
  292. color: #0F1826;
  293. line-height: 48rpx;
  294. }
  295. .u-model__footer__button.data-v-3626fcec {
  296. border-right: 1rpx solid #333;
  297. }
  298. </style>