ck.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="topLeft">
  5. <image src="/static/images/wx.png" mode="" class="carLogo"></image>
  6. </view>
  7. <view class="topRight">
  8. <view class="brand">{{info.carModelInfo.brand}}</view>
  9. <view class="carModel">{{info.title}}</view>
  10. </view>
  11. </view>
  12. <view class="cont">
  13. <view class="line" v-for="(item,index) in info.supplierlist">
  14. <view class="lineLeft">
  15. <view class="lineCK">
  16. <checkbox-group>
  17. <label>
  18. <checkbox value="cb" :checked="true" />
  19. </label>
  20. </checkbox-group>
  21. </view>
  22. <view class="nameBox">
  23. <view class="name">{{item.supplierName}}</view>
  24. <view class="jingying">经营品牌:{{item.brands}}</view>
  25. </view>
  26. </view>
  27. <view class="lineRgiht">
  28. <view>
  29. <image class="lineRgihtIMg" src="/static/images/icon_phone@2x.png" mode=""></image>
  30. </view>
  31. <view>
  32. <image @click="goIm(item)" class="lineRgihtIMg" src="/static/images/chat.png" mode=""></image>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="qunfa" @click="qunfa">
  38. 一键群发
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import EmojiDecoder from '../lib/EmojiDecoder';
  44. import restApi from '../lib/restapi';
  45. import {formatDate} from '../lib/utils';
  46. import RecorderManager from '../lib/RecorderManager';
  47. const IMAGE_MAX_WIDTH = 200;
  48. const IMAGE_MAX_HEIGHT = 150;
  49. const recorderManager = new RecorderManager();
  50. const GoEasy = uni.$GoEasy;
  51. const GRTC = uni.$GRTC;
  52. export default {
  53. data() {
  54. return {
  55. vin: 'JHMCM56557C404453',
  56. list:[],
  57. info:'',
  58. currentUser:'',
  59. }
  60. },
  61. onLoad(opt) {
  62. var token=opt.token
  63. console.log(token)
  64. uni.setStorageSync('token', token);
  65. this.vinSupplier()
  66. this.imLoginUrl()
  67. },
  68. methods: {
  69. qunfa(){
  70. uni.setStorageSync('supplierlist', this.info.supplierlist);
  71. uni.navigateTo({
  72. url:'qunfa'
  73. })
  74. },
  75. goIm(item){
  76. uni.setStorage({
  77. key: 'friend',
  78. data: item,
  79. success: function () {
  80. uni.navigateTo({
  81. url: './privateChat?to=' + item.id
  82. });
  83. }
  84. });
  85. },
  86. vinSupplier(){
  87. this.$http('imSys/vinSupplier', {
  88. vin:this.vin,
  89. },'GET').then(res => {
  90. //console.log(res)
  91. this.info=res.data[0]
  92. })
  93. },
  94. imLoginUrl(){
  95. this.$http('imSys/imLoginUrl', {
  96. token:this.token,
  97. },'POST').then(res => {
  98. // console.log(res)
  99. var users={
  100. userId:res.data.userId,
  101. name:res.data.users.name,
  102. avatar:'',
  103. }
  104. this.currentUser=users
  105. this.connectGoEasy()
  106. uni.setStorageSync('users', users);
  107. })
  108. },
  109. connectGoEasy(){
  110. console.log(this.currentUser)
  111. this.currentUser.id="2C3E3A5C-D449-4439-842F-8E1C5C9EF91E"
  112. uni.setStorageSync('currentUser', this.currentUser);
  113. GoEasy.connect({
  114. id: this.currentUser.id,
  115. data: {
  116. name: this.currentUser.name,
  117. avatar: this.currentUser.avatar
  118. },
  119. onSuccess: () => {
  120. console.log('GoEasy connect successfully.')
  121. },
  122. onFailed: (error) => {
  123. console.log('Failed to connect GoEasy, code:' + error.code + ',error:' + error.content);
  124. },
  125. onProgress: (attempts) => {
  126. console.log('GoEasy is connecting', attempts);
  127. }
  128. });
  129. }
  130. }
  131. }
  132. </script>
  133. <style scoped>
  134. .content{
  135. min-height: 100vh;
  136. background: #F4F5F7;
  137. }
  138. .carLogo{
  139. width: 80rpx;height: 80rpx;
  140. }
  141. .top{
  142. padding: 24rpx;
  143. display: flex;
  144. background: #FFF;
  145. }
  146. .topRight{
  147. padding-left: 10rpx;
  148. }
  149. .brand{
  150. font-size: 28rpx;
  151. color: #333;
  152. }
  153. .carModel{
  154. font-size: 26rpx;
  155. padding-top: 8rpx;
  156. color: #999;
  157. }
  158. .lineRgihtIMg{
  159. width: 40rpx;
  160. height: 40rpx;
  161. }
  162. .cont{
  163. margin-top: 20rpx;
  164. background: #FFF;
  165. }
  166. .line{
  167. display: flex;justify-content: space-between;
  168. padding: 20rpx;
  169. border-bottom: 1px solid #F4F5F7;
  170. }
  171. .lineLeft{
  172. display: flex;
  173. }
  174. .nameBox{
  175. padding-left: 10rpx;
  176. }
  177. .name{
  178. font-size: 30rpx;color: #333;
  179. }
  180. .jingying{
  181. font-size: 26rpx;color: #999;padding-top: 10rpx;
  182. }
  183. .lineCK{
  184. display: flex;
  185. align-items: center;
  186. }
  187. .qunfa{
  188. width: 650rpx;
  189. height: 80rpx;
  190. line-height: 80rpx;
  191. text-align: center;
  192. background: #3F90F7;
  193. color: #ffffff;
  194. font-size: 30rpx;
  195. border-radius: 10rpx;
  196. margin: 0 auto;
  197. margin-top: 100rpx;
  198. }
  199. </style>