editOutbound.vue 10 KB

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