editOutbound.vue 9.2 KB

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