vip-dialog.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. var vipDialog = `
  2. <div class="vip_openDialog">
  3. <div class="vip_content">
  4. <div class="vip_content_div">
  5. <img class="vip_img" :src="imgurl" />
  6. <span class="vip_example">示例</span>
  7. </div>
  8. </div>
  9. <div class="vip_head">
  10. <span style="display:none;">{{getTextMap.titleText}}</span>
  11. <span class="vip_extend"><span>{{getTextMap.headText.top}}</span><br/>{{getTextMap.headText.bot}}</span>
  12. </div>
  13. <div class="openBtn">
  14. <button class="goBtn" @click="goOpen(getTextMap.source)">{{getTextMap.btnText}}</button>
  15. </div>
  16. <p class="no-login-tip" v-if="!islogin">登录后解锁会员查看更多内容</p>
  17. </div>
  18. `
  19. var vipComponent = {
  20. name: 'vip-dialog',
  21. template: vipDialog,
  22. props: {
  23. 'imgurl': {
  24. type: String,
  25. default: function() {
  26. return ''
  27. }
  28. },
  29. "canFreeExp": {
  30. type: Boolean,
  31. default: function () {
  32. return false
  33. }
  34. },
  35. "entvisit": {
  36. type: Object,
  37. default: function () {
  38. return {
  39. total: 0, // 本月画像次数总量
  40. usage: 0, // 本月已使用次数
  41. provin: 0 // 购买省份数量
  42. }
  43. }
  44. },
  45. "type": {
  46. type: String,
  47. default: function () {
  48. return ''
  49. }
  50. },
  51. "vipststus": {
  52. type: Number,
  53. default: function () {
  54. return 0
  55. }
  56. },
  57. "power": {
  58. type: Object,
  59. default: function () {
  60. return {}
  61. }
  62. },
  63. 'newvip': {
  64. type: Boolean,
  65. default: function() {
  66. return false
  67. }
  68. },
  69. 'islogin': {
  70. type: Boolean,
  71. default: function() {
  72. return false
  73. }
  74. }
  75. },
  76. data: function() {
  77. return {
  78. titleText: '开通超级订阅',
  79. btnText: '去开通',
  80. headText: {
  81. top: '通过实时监控项目的招标、中标、合同等',
  82. bot: '信息,全面挖掘更多潜在商机!'
  83. }
  84. }
  85. },
  86. computed: {
  87. getTextMap () {
  88. // console.log(this.power)
  89. var textMap = {
  90. titleText: '开通超级订阅',
  91. btnText: '去开通',
  92. headText: {
  93. top: '通过实时监控项目的招标、中标、合同等',
  94. bot: '信息,全面挖掘更多潜在商机!'
  95. },
  96. source: ''
  97. }
  98. // console.log(this.power, this.power.isMember, this.power._4, this.power._13, this.newvip,this.entvisit, this.power.vipStatus)
  99. if (this.power.isMember > 0 ) {
  100. if (this.entvisit.total <= this.entvisit.usage && this.newvip) {
  101. textMap.btnText = '联系客服'
  102. } else {
  103. if (this.type === 'item_8' || this.type === 'item_9') {
  104. textMap.btnText = '联系客服'
  105. } else {
  106. textMap.btnText = !this.newvip && this.power.vipStatus > 0 ? '前往升级' : '去开通'
  107. }
  108. }
  109. } else {
  110. if (this.entvisit.total <= this.entvisit.usage && this.newvip) {
  111. if (this.entvisit.provin == 0) {
  112. textMap.btnText = '去开通'
  113. } else if (this.entvisit.provin != -1) {
  114. textMap.titleText = '超级订阅'
  115. textMap.btnText = '前往升级'
  116. if (this.type === 'item_8' || this.type === 'item_9') {
  117. textMap.btnText = '免费体验'
  118. }
  119. } else if(this.entvisit.provin == -1) {
  120. textMap.titleText = '超级订阅'
  121. textMap.btnText = '联系客服'
  122. if (this.type === 'item_8' || this.type === 'item_9') {
  123. textMap.btnText = '免费体验'
  124. }
  125. }
  126. } else {
  127. if (this.type === 'item_8' || this.type === 'item_9') {
  128. textMap.btnText = '免费体验'
  129. } else {
  130. textMap.btnText = !this.newvip && this.power.vipStatus > 0 ? '前往升级' : '去开通'
  131. }
  132. }
  133. // (2)【立即解锁】:未体验过企业画像的免费用户,中标分析各模块,点击进行“欢迎体验企业中标分析”留资;
  134. if (this.canFreeExp) {
  135. // textMap.btnText = '立即解锁'
  136. // 免费体验功能已经下掉,此处改为引导购买
  137. textMap.btnText = '去开通'
  138. } else {
  139. if (this.power.vipStatus <= 0) {
  140. textMap.btnText = '去开通'
  141. } else if (!this.newvip && this.entvisit.provin != -1 && this.entvisit.total >= 0) {
  142. // (4)【前往升级】:超级订阅老版用户,中标分析各模块;购买了非全国的超级订阅新版用户且企业画像余额为0;点击进入超级订阅升级页;
  143. textMap.btnText = '前往升级'
  144. }
  145. }
  146. }
  147. switch (this.type) {
  148. // 项目动态
  149. case 'item_1': {
  150. textMap.headText.top = '通过实时监控项目的招标、中标、合同等'
  151. textMap.headText.bot = '信息,全面挖掘更多潜在商机!'
  152. textMap.source = 'ent_portrait_winnerNewMsg_freeuser'
  153. break
  154. }
  155. // 年度项目统计
  156. case 'item_2': {
  157. textMap.titleText = '开通大会员'
  158. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  159. textMap.headText.top = '年度项目规模、增长趋势一目了然,'
  160. textMap.headText.bot = '快速分析市场!'
  161. textMap.source = 'ent_portrait_yearData_freeuser'
  162. break
  163. }
  164. // 月度中标金额统计
  165. case 'item_3': {
  166. textMap.titleText = '开通大会员'
  167. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  168. textMap.headText.top = '纵向对比采购单位近三年月度采购规模,'
  169. textMap.headText.bot = '不错过任何商机!'
  170. textMap.source = 'ent_portrait_monthData_freeuser'
  171. break
  172. }
  173. // 市场区域分布
  174. case 'item_4': {
  175. textMap.titleText = '开通大会员'
  176. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  177. textMap.headText.top = '通过企业市场规模、市场格局,'
  178. textMap.headText.bot = '分析企业的市场发展现状!'
  179. textMap.source = 'ent_portrait_areaData_freeuser'
  180. break
  181. }
  182. // 各类客户平均折扣率
  183. case 'item_5': {
  184. textMap.titleText = '开通大会员'
  185. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  186. textMap.headText.top = '通过近3年各类客户平均折扣率范围,'
  187. textMap.headText.bot = '透视企业的行业盈利能力!'
  188. textMap.source = 'ent_portrait_discountRate_freeuser'
  189. break
  190. }
  191. // 客户类型分布
  192. case 'item_6': {
  193. textMap.titleText = '开通大会员'
  194. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  195. textMap.headText.top = '通过企业主要客户类型分析,'
  196. textMap.headText.bot = '洞悉企业业务模式、经营状况!'
  197. textMap.source = 'ent_portrait_top10_freeuser'
  198. break
  199. }
  200. // 重点客户
  201. case 'item_7': {
  202. textMap.titleText = '开通大会员'
  203. // textMap.btnText = this.power.isMember > 0 && !this.power._4 ? '联系客服' : '免费体验'
  204. textMap.headText.top = '通过挖掘企业重点及首次合作客户,直观了解'
  205. textMap.headText.bot = '采购单位与供应商关系远近,辅助投标决策!'
  206. textMap.source = 'ent_portrait_topShow_freeuser'
  207. break
  208. }
  209. // 企业情报历史记录
  210. case 'item_8': {
  211. textMap.titleText = '开通大会员'
  212. textMap.btnText = this.power.isMember > 0 && !this.power._12 ? '联系客服' : '免费体验'
  213. textMap.headText.top = '快速查询全国企业工商信息、法人信息、'
  214. textMap.headText.bot = '联系方式,全面掌控企业动态!'
  215. textMap.source = 'ent_portrait_changeList'
  216. break
  217. }
  218. // 历史项目联系方式
  219. case 'item_9': {
  220. textMap.titleText = '开通大会员'
  221. textMap.btnText = this.power.isMember > 0 && this.power.arr.indexOf(4) == -1 ? '联系客服' : '免费体验'
  222. textMap.headText.top = '获取企业联系人信息,一键拨打!'
  223. textMap.headText.bot = ''
  224. textMap.source = 'ent_portrait_contacts'
  225. break
  226. }
  227. // 统计信息-概况
  228. case 'item_10': {
  229. textMap.titleText = ''
  230. textMap.btnText = this.power.isFree ? '去开通' : '前往升级'
  231. textMap.headText.top = '全面透视企业历史中标项目、中标'
  232. textMap.headText.bot = '金额、客户数量'
  233. textMap.source = 'ent_portrait_bidInfoDesc'
  234. break
  235. }
  236. default: {
  237. textMap.headText.top = '通过实时监控项目的招标、中标、合同等'
  238. textMap.headText.bot = '信息,全面挖掘更多潜在商机!'
  239. textMap.source = 'ent_portrait_new_free'
  240. break
  241. }
  242. }
  243. // 未登录
  244. if(!this.islogin) {
  245. textMap.btnText = '登录查看'
  246. }
  247. return textMap
  248. },
  249. },
  250. methods: {
  251. goOpenOfApp: function (btnText, source) {
  252. switch (btnText) {
  253. case '去开通': {
  254. if(this.type == 'item_9' || this.type == 'item_8') {
  255. // 跳转到大会员
  256. // location.href = '/jyapp/big/page/buy_commit'
  257. location.href = '/jy_mobile/common/order/create/bigmember'
  258. // location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=ent_portrait'
  259. } else {
  260. // 跳转到超级订阅
  261. // location.href = '/jyapp/vipsubscribe/vipsubscribe_new'
  262. location.href = '/jy_mobile/common/order/create/svip?type=buy'
  263. }
  264. break
  265. }
  266. case '免费体验': {
  267. location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=' + source
  268. break
  269. }
  270. case '前往升级': {
  271. //跳转清除旧套餐缓存,防止计算价格出错
  272. sessionStorage.removeItem('vipSub_oldBuySet')
  273. // location.href = '/jyapp/vipsubscribe/upgradePage'
  274. location.href = '/jy_mobile/common/order/create/svip?type=upgrade'
  275. break
  276. }
  277. case '联系客服': {
  278. location.href = '/jyapp/free/customer'
  279. break
  280. }
  281. case '立即解锁': {
  282. location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=ent_portrait_freeuser'
  283. break
  284. }
  285. case '登录查看': {
  286. location.href = '/jyapp/free/login?to=back'
  287. break
  288. }
  289. default: {
  290. // location.href = '/jyapp/vipsubscribe/vipsubscribe_new'
  291. location.href = '/jy_mobile/common/order/create/svip?type=buy'
  292. break
  293. }
  294. }
  295. },
  296. goOpenOfWx: function (btnText, source) {
  297. switch (btnText) {
  298. case '去开通': {
  299. if(this.type == 'item_9' || this.type == 'item_8') {
  300. // 跳转到大会员
  301. // location.href = '/big/wx/page/buy_commit'
  302. location.href = '/jy_mobile/common/order/create/bigmember'
  303. } else {
  304. // 跳转到超级订阅
  305. // location.href = '/front/vipsubscribe/vipsubscribe_new'
  306. location.href = '/jy_mobile/common/order/create/svip?type=buy'
  307. }
  308. break
  309. }
  310. case '免费体验': {
  311. location.href = '/weixin/frontPage/bigmember/free/perfect_info?source=' + source
  312. break
  313. }
  314. case '前往升级': {
  315. // location.href = '/front/vipsubscribe/upgradePage'
  316. location.href = '/jy_mobile/common/order/create/svip?type=upgrade'
  317. break
  318. }
  319. case '联系客服': {
  320. location.href = '/big/wx/page/customer'
  321. break
  322. }
  323. case '立即解锁': {
  324. location.href = '/weixin/frontPage/bigmember/free/perfect_info?source=ent_portrait_freeuser'
  325. break
  326. }
  327. default: {
  328. // location.href = '/front/vipsubscribe/vipsubscribe_new'
  329. location.href = '/jy_mobile/common/order/create/svip?type=buy'
  330. break
  331. }
  332. }
  333. },
  334. goOpen: function(source) {
  335. // 点击按钮保存tabActiveName值
  336. this.$emit('tabactive', 'save')
  337. const isWeixin = utils.isWeiXinBrowser
  338. if (isWeixin) {
  339. this.goOpenOfWx(this.getTextMap.btnText, source)
  340. } else {
  341. this.goOpenOfApp(this.getTextMap.btnText, source)
  342. }
  343. }
  344. }
  345. }