editOutbound.vue 9.3 KB

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